diff --git a/monitor.py b/monitor.py index 667c17e1..c6837b2f 100644 --- a/monitor.py +++ b/monitor.py @@ -1687,23 +1687,22 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below return False if 'Progress' in entry: - # Progress can be only a single Engineer, so it's not an array + # Progress is only a single Engineer, so it's not an array # { "timestamp":"2021-05-24T17:57:52Z", # "event":"EngineerProgress", # "Engineer":"Felicity Farseer", # "EngineerID":300100, # "Progress":"Invited" } - for e in entry.get('Engineers', entry): - for f in ('Engineer', 'EngineerID', 'Rank', 'Progress', 'RankProgress'): - if f not in e: - # For some Progress there's no Rank/RankProgress yet - if f in ('Rank', 'RankProgress'): - if (progress := e.get('Progress', None)) is not None: - if progress in ('Invited', 'Known'): - continue + for f in ('Engineer', 'EngineerID', 'Rank', 'Progress', 'RankProgress'): + if f not in entry: + # For some Progress there's no Rank/RankProgress yet + if f in ('Rank', 'RankProgress'): + if (progress := entry.get('Progress', None)) is not None: + if progress in ('Invited', 'Known'): + continue - logger.warning(f"Engineer entry without '{f}' key: {e=} in {entry=}") - return False + logger.warning(f"Progress event without '{f}' key: {entry=}") + return False return True