added standard-theme function

This commit is contained in:
2026-02-19 13:44:40 +01:00
parent a027cf8c1c
commit b5f0146cc4
6 changed files with 91 additions and 9 deletions
+17
View File
@@ -144,3 +144,20 @@ def load_soundboard_config(filename, config_dir, sounds_dir=None):
for item in data[key]:
item.setdefault('base_path', base_sound_dir)
return data
def read_default_theme(path):
try:
if not os.path.exists(path):
return None
with open(path, 'r', encoding='utf-8') as f:
val = f.read().strip()
return val or None
except Exception:
return None
def write_default_theme(path, filename):
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, 'w', encoding='utf-8') as f:
f.write(filename)