1- from configparser import ConfigParser
21from typing import List
32
4- from aw_core .config import load_config
5- import json
3+ from aw_core .config import load_config_toml
64
7- # NOTE: Updating this won't update the defaults for users, this is an issue with how aw_core.config works
8- default_settings = {
9- "autostart_modules" : json .dumps (
10- ["aw-server" , "aw-watcher-afk" , "aw-watcher-window" ,]
11- ),
12- }
135
14- default_config = ConfigParser ()
15- default_config ["aw-qt" ] = default_settings
16- # Currently there's no reason to make them differ
17- default_config ["aw-qt-testing" ] = default_settings
6+ default_config = """
7+ [aw-qt]
8+ autostart_modules = ["aw-server", "aw-watcher-afk", "aw-watcher-window"]
9+
10+ [aw-qt-testing]
11+ autostart_modules = ["aw-server", "aw-watcher-afk", "aw-watcher-window"]
12+ """ .strip ()
1813
1914
2015class AwQtSettings :
@@ -23,9 +18,7 @@ def __init__(self, testing: bool):
2318 An instance of loaded settings, containing a list of modules to autostart.
2419 Constructor takes a `testing` boolean as an argument
2520 """
26- qt_config = load_config ("aw-qt" , default_config )
27- config_section = qt_config ["aw-qt" if not testing else "aw-qt-testing" ]
21+ config = load_config_toml ("aw-qt" , default_config )
22+ config_section = config ["aw-qt" if not testing else "aw-qt-testing" ]
2823
29- self .autostart_modules : List [str ] = json .loads (
30- config_section ["autostart_modules" ]
31- )
24+ self .autostart_modules : List [str ] = config_section ["autostart_modules" ]
0 commit comments