File tree Expand file tree Collapse file tree 3 files changed +49
-22
lines changed
Expand file tree Collapse file tree 3 files changed +49
-22
lines changed Original file line number Diff line number Diff line change 1- from configparser import ConfigParser
1+ from aw_core . config import load_config_toml
22
3- from aw_core .config import load_config
3+ default_config = """
4+ [server]
5+ host = "localhost"
6+ port = "5600"
7+ storage = "peewee"
8+ cors_origins = ""
49
5- default_config = ConfigParser ()
6- default_config ["server" ] = {
7- "host" : "localhost" ,
8- "port" : "5600" ,
9- "storage" : "peewee" ,
10- "cors_origins" : "" ,
11- }
12- default_config ["server-testing" ] = {
13- "host" : "localhost" ,
14- "port" : "5666" ,
15- "storage" : "peewee" ,
16- "cors_origins" : "" ,
17- }
10+ [server-testing]
11+ host = "localhost"
12+ port = "5666"
13+ storage = "peewee"
14+ cors_origins = ""
15+ """ .strip ()
1816
19- config = load_config ("aw-server" , default_config )
17+ config = load_config_toml ("aw-server" , default_config )
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ def parse_settings():
8080 configsection = "server" if not args .testing else "server-testing"
8181 settings = argparse .Namespace ()
8282 settings .host = config [configsection ]["host" ]
83- settings .port = config [configsection ]. getint ( "port" )
83+ settings .port = int ( config [configsection ][ "port" ] )
8484 settings .storage = config [configsection ]["storage" ]
8585 settings .cors_origins = config [configsection ]["cors_origins" ]
8686
You can’t perform that action at this time.
0 commit comments