initial commit
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
PRESETS_DIR = os.path.join(BASE_DIR, "presets")
|
||||
PRESETS_FILE = os.path.join(PRESETS_DIR, "presets.json")
|
||||
os.makedirs(PRESETS_DIR, exist_ok=True)
|
||||
|
||||
def load_presets_file():
|
||||
if os.path.exists(PRESETS_FILE):
|
||||
with open(PRESETS_FILE, "r") as f:
|
||||
return json.load(f)
|
||||
return {"__last_used__": None, "presets": {}}
|
||||
|
||||
def save_presets_file(data):
|
||||
with open(PRESETS_FILE, "w") as f:
|
||||
json.dump(data, f, indent=2)
|
||||
Reference in New Issue
Block a user