Browse Source

Switch to YAML instead of TOML for config file

Frans Bergman 7 years ago
parent
commit
bf68586d54
4 changed files with 6 additions and 5 deletions
  1. 2 2
      citybuilder/core.py
  2. 0 2
      config/core.toml
  3. 3 0
      config/game.yaml
  4. 1 1
      requirements.txt

+ 2 - 2
citybuilder/core.py

@@ -1,4 +1,4 @@
-import toml
+import yaml
 import _thread
 from . import server
 import time
@@ -9,7 +9,7 @@ def main_loop():
     time.sleep(100)
 
 if __name__ == '__main__':
-    config = toml.load("config/core.toml")
+    config = yaml.load(open("config/game.yaml"))['game']
     def run(*args):
         server.run_server(config)
         print("Websocket thread terminated.")

+ 0 - 2
config/core.toml

@@ -1,2 +0,0 @@
-[server]
-port = 6060

+ 3 - 0
config/game.yaml

@@ -0,0 +1,3 @@
+game:
+  server:
+    port: 6060

+ 1 - 1
requirements.txt

@@ -1,3 +1,3 @@
 passlib==1.7.1
 SimpleWebSocketServer==0.1.0
-toml==0.9.2
+PyYAML==3.12