-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show RGP steam from new recorder service
- Loading branch information
Showing
2 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from __future__ import annotations | ||
from farm_ng.core.events_file_reader import EventLogPosition | ||
|
||
|
||
def build_events_dict( | ||
events_index: list[EventLogPosition], | ||
) -> dict[str, list[EventLogPosition]]: | ||
"""Build a dictionary of lists of events, where the key is the path of the event. | ||
Args: | ||
events_index (list[EventLogPosition]): [description] | ||
Returns: | ||
dict[str, list[EventLogPosition]]: [description] | ||
""" | ||
events_dict: dict[str, list[EventLogPosition]] = {} | ||
for event_index in events_index: | ||
if event_index.event.uri.path not in events_dict: | ||
events_dict[event_index.event.uri.path] = [] | ||
events_dict[event_index.event.uri.path].append(event_index) | ||
return events_dict |