change profile to config

change profile to config
This commit is contained in:
onyx-and-iris 2022-06-17 17:53:46 +01:00
parent 94d5596d60
commit 9292ed4815
4 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
# load a specific profile on start (file name without .toml ext)
# [profiles]
# profile="example"
# [configs]
# config="example"
# load with themes enabled? set the default mode
[theme]
enabled=true

View File

@ -44,8 +44,8 @@ class App(tk.Tk):
self.bus_levels = None
self["menu"] = Menus(self, vmr)
self.styletable = ttk.Style()
if _configuration.profile:
vmr.apply_config(_configuration.profile)
if _configuration.config:
vmr.apply_config(_configuration.config)
self.build_app()

View File

@ -15,15 +15,15 @@ for path in config_path:
with open(filename, "rb") as f:
configs[name] = tomllib.load(f)
except tomllib.TOMLDecodeError:
print(f"Invalid TOML profile: configs/{filename.stem}")
print(f"Invalid TOML config: configs/{filename.stem}")
for name, cfg in configs.items():
print(f"Loaded configuration configs/{name}")
configuration[name] = cfg
_defaults = {
"profiles": {
"profile": None,
"configs": {
"config": None,
},
"theme": {
"enabled": True,

View File

@ -38,9 +38,9 @@ class Configurations(metaclass=SingletonMeta):
level_height: int = configuration["channel"]["height"]
@property
def profile(self):
if "profiles" in configuration:
return configuration["profiles"]["profile"]
def config(self):
if "configs" in configuration:
return configuration["configs"]["config"]
@dataclass