diff options
author | Eddy Pedroni <epedroni@pm.me> | 2024-09-26 10:02:15 +0200 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2024-09-26 10:02:15 +0200 |
commit | e65bef9c22244fc9bcd22a37d335f5f76ba16ff5 (patch) | |
tree | 9af6fa41bfee6fc03c3ab30cf1b23a82bdf8f2e7 /src/state_json.py | |
parent | ce76b00d7b2ccac6843732f92becfabb753864a0 (diff) |
Create separate packages for library and CLI
Diffstat (limited to 'src/state_json.py')
-rw-r--r-- | src/state_json.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/state_json.py b/src/state_json.py deleted file mode 100644 index a0b487e..0000000 --- a/src/state_json.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -Helper functions to store scheduler state as json -""" - -import json -from pathlib import Path - -def save(file: str, state: dict) -> None: - """ - Dump the specified state dictionary in JSON format - """ - with open(file, "w") as f: - json.dump(state, f) - -def load(file: str) -> dict: - """ - Load the state from the specified file and return - an empty dictionary silently if the file doesn't exist. - """ - try: - with open(file, "r") as f: - return json.load(f) - except: - return {} |