commit 6e8ecf84469c67d1c4aa0694df9551bd7934c827
parent 6189385e5425486b015cddd9440379a7c84c5e11
Author: Carlosokumu <carlosokumu254@gmail.com>
Date: Mon, 13 Jul 2026 11:54:50 +0300
remove the StateManager
Diffstat:
1 file changed, 0 insertions(+), 28 deletions(-)
diff --git a/dummy/usawa/gui/core/state_manager.py b/dummy/usawa/gui/core/state_manager.py
@@ -1,28 +0,0 @@
-import json
-from pathlib import Path
-
-STATE_FILE = Path.home() / ".local" / "share" / "usawa" / "state.json"
-
-
-class StateManager:
-
- @staticmethod
- def get_state() -> dict:
- if STATE_FILE.exists():
- return json.loads(STATE_FILE.read_text())
- return {}
-
- @staticmethod
- def save_state(data: dict):
- STATE_FILE.parent.mkdir(parents=True, exist_ok=True)
- STATE_FILE.write_text(json.dumps(data, indent=2))
-
- @staticmethod
- def get(key: str, default=None):
- return StateManager.get_state().get(key, default)
-
- @staticmethod
- def set(key: str, value):
- state = StateManager.get_state()
- state[key] = value
- StateManager.save_state(state)