From 9292ed4815c978fb9ba24997aa65e9071d06c5fc Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Fri, 17 Jun 2022 17:53:46 +0100 Subject: [PATCH] change profile to config change profile to config --- configs/app.toml | 4 ++-- vmcompact/app.py | 4 ++-- vmcompact/configurations.py | 6 +++--- vmcompact/data.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/app.toml b/configs/app.toml index 6777168..24e75f1 100644 --- a/configs/app.toml +++ b/configs/app.toml @@ -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 diff --git a/vmcompact/app.py b/vmcompact/app.py index fe7c786..b7072fd 100644 --- a/vmcompact/app.py +++ b/vmcompact/app.py @@ -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() diff --git a/vmcompact/configurations.py b/vmcompact/configurations.py index 79f33ed..011cf82 100644 --- a/vmcompact/configurations.py +++ b/vmcompact/configurations.py @@ -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, diff --git a/vmcompact/data.py b/vmcompact/data.py index 724c9dd..f4120c0 100644 --- a/vmcompact/data.py +++ b/vmcompact/data.py @@ -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