mirror of
https://github.com/onyx-and-iris/nvda-addon-voicemeeter.git
synced 2024-11-15 23:10:47 +00:00
21 lines
397 B
Python
21 lines
397 B
Python
|
import json
|
||
|
from pathlib import Path
|
||
|
|
||
|
|
||
|
def config_from_json():
|
||
|
pn = Path.home() / "Documents" / "Voicemeeter" / "nvda_settings.json"
|
||
|
data = None
|
||
|
if pn.exists():
|
||
|
with open(pn, "r") as f:
|
||
|
data = json.load(f)
|
||
|
return data or {}
|
||
|
|
||
|
|
||
|
__config = config_from_json()
|
||
|
|
||
|
|
||
|
def get(name, default=None):
|
||
|
if name in __config:
|
||
|
return __config[name]
|
||
|
return default
|