updated event dict to always include path, should be more future proof

This commit is contained in:
PatchOfScotland
2023-01-20 11:03:16 +01:00
parent 226bf7a7f9
commit 75de8147be
5 changed files with 24 additions and 23 deletions

View File

@ -16,7 +16,7 @@ from core.correctness.validation import check_type, valid_existing_file_path, \
valid_path
from core.correctness.vars import CHAR_LOWERCASE, CHAR_UPPERCASE, \
VALID_CHANNELS, HASH_BUFFER_SIZE, SHA256, DEBUG_WARNING, DEBUG_INFO, \
EVENT_TYPE
EVENT_TYPE, EVENT_PATH
def generate_id(prefix:str="", length:int=16, existing_ids:list[str]=[],
charset:str=CHAR_UPPERCASE+CHAR_LOWERCASE, attempts:int=24):
@ -241,6 +241,6 @@ def print_debug(print_target, debug_level, msg, level)->None:
status = "WARNING"
print(f"{status}: {msg}", file=print_target)
def create_event(event_type:str, source:dict[Any,Any]={})->dict[Any,Any]:
return {**source, EVENT_TYPE: event_type}
def create_event(event_type:str, path:str, source:dict[Any,Any]={})->dict[Any,Any]:
return {**source, EVENT_PATH: path, EVENT_TYPE: event_type}