aboutsummaryrefslogtreecommitdiff
path: root/Config.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-07-16 00:36:52 +0100
committerGravatar jesopo2018-07-16 00:36:52 +0100
commite06d5f37f8912802d2937cc73d99942e6cb21ea4 (patch)
treee65257e63d1e0f3f3b80f49d5dc4ccbcf85170db /Config.py
parentmove sasl logic to it's own module (diff)
signature
switch to using configparser for config files
Diffstat (limited to 'Config.py')
-rw-r--r--Config.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Config.py b/Config.py
index 06a00378..21a144cf 100644
--- a/Config.py
+++ b/Config.py
@@ -1,7 +1,7 @@
-import json, os
+import configparser, os
class Config(object):
- def __init__(self, bot, location="bot.json"):
+ def __init__(self, bot, location="bot.conf"):
self.bot = bot
self.location = location
self.full_location = os.path.join(bot.bot_directory,
@@ -12,4 +12,6 @@ class Config(object):
def load_config(self):
if os.path.isfile(self.full_location):
with open(self.full_location) as config_file:
- self.bot.config = json.loads(config_file.read())
+ parser = configparser.ConfigParser()
+ parser.read_string(config_file.read())
+ self.bot.config = dict(parser["bot"].items())