diff options
| author | 2018-07-16 00:36:52 +0100 | |
|---|---|---|
| committer | 2018-07-16 00:36:52 +0100 | |
| commit | e06d5f37f8912802d2937cc73d99942e6cb21ea4 (patch) | |
| tree | e65257e63d1e0f3f3b80f49d5dc4ccbcf85170db /Config.py | |
| parent | move 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.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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()) |
