diff --git a/functionality/file_io.py b/functionality/file_io.py index c631bb0..1737a66 100644 --- a/functionality/file_io.py +++ b/functionality/file_io.py @@ -131,7 +131,7 @@ def threadsafe_update_status(updates:dict[str,Any], filepath:str): try: status = read_yaml(filepath) - write_yaml(generous_merge(status, updates), filepath) + write_yaml({**status, **updates}, filepath) except Exception as e: lock_handle.close() raise e @@ -160,18 +160,3 @@ def lines_to_string(lines:List[str])->str: """Function to convert a list of str lines, into one continuous string separated by newline characters""" return "\n".join(lines) - -def generous_merge(source:dict[str,Any], update:dict[str,Any], top:bool=True): - result = {} - - for k, v in source.items(): - if k in update: - if isinstance(v, dict): - result[k] = generous_merge(v, update[k], top=False) - else: - result[k] = update[k] - - else: - result[k] = v - - return result \ No newline at end of file diff --git a/tests/test_functionality.py b/tests/test_functionality.py index 936418f..f951e80 100644 --- a/tests/test_functionality.py +++ b/tests/test_functionality.py @@ -484,7 +484,6 @@ data""" 'A: a\n', 'B: 42\n', 'C:\n', - ' D: true\n', ' E:\n', ' - 1\n', ' - 2\n',