diff options
| author | 2020-01-30 11:50:40 +0000 | |
|---|---|---|
| committer | 2020-01-30 11:50:40 +0000 | |
| commit | 49f14caf42e44b362f815273a5b5e4699f5678df (patch) | |
| tree | ba5ff0bea49395541d50f4f31772a7b2aa71042e /src | |
| parent | update aliases.py to use command specs (diff) | |
| signature | ||
support different Config names
Diffstat (limited to 'src')
| -rw-r--r-- | src/Config.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Config.py b/src/Config.py index 579b2dec..06926dbb 100644 --- a/src/Config.py +++ b/src/Config.py @@ -1,8 +1,8 @@ import collections, configparser, os, typing class Config(object): - - def __init__(self, location: str): + def __init__(self, name: str, location: str): + self._name = name self.location = location self._config: typing.Dict[str, str] = collections.OrderedDict() @@ -15,14 +15,14 @@ class Config(object): parser = self._parser() parser.read_string(config_file.read()) self._config.clear() - for k, v in parser["bot"].items(): + for k, v in parser[self._name].items(): if v: self._config[k] = v def save(self): with open(self.location, "w") as config_file: parser = self._parser() - parser["bot"] = self._config.copy() + parser[self._name] = self._config.copy() parser.write(config_file) def __getitem__(self, key: str) -> typing.Any: |
