mirror of
https://github.com/onyx-and-iris/voicemeeter-compact.git
synced 2026-04-18 05:23:31 +00:00
initial commit
initial commit
This commit is contained in:
20
vmcompact/configurations.py
Normal file
20
vmcompact/configurations.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import toml
|
||||
from pathlib import Path
|
||||
|
||||
configuration = {}
|
||||
|
||||
config_path = [Path.cwd() / "configs"]
|
||||
for path in config_path:
|
||||
if path.is_dir():
|
||||
filenames = list(path.glob("*.toml"))
|
||||
configs = {}
|
||||
for filename in filenames:
|
||||
name = filename.with_suffix("").stem
|
||||
try:
|
||||
configs[name] = toml.load(filename)
|
||||
except toml.TomlDecodeError:
|
||||
print(f"Invalid TOML profile: configs/{filename.stem}")
|
||||
|
||||
for name, cfg in configs.items():
|
||||
print(f"Loaded profile configs/{name}")
|
||||
configuration[name] = cfg
|
||||
Reference in New Issue
Block a user