added standard-theme function
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user