mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
fix
This commit is contained in:
parent
155afcb25e
commit
64be7e4a6f
@ -17,17 +17,17 @@ class BotConfig():
|
|||||||
def load_config(self):
|
def load_config(self):
|
||||||
|
|
||||||
# Load config
|
# Load config
|
||||||
|
parser = build_parser()
|
||||||
if not len(sys.argv[1:]):
|
if not len(sys.argv[1:]):
|
||||||
argv = ['legacy']
|
argv = ['legacy']
|
||||||
else:
|
else:
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
parser = build_parser()
|
|
||||||
opts = parser.parse_args(argv)
|
opts = parser.parse_args(argv)
|
||||||
config_module = get_configuration(opts)
|
config_module = get_configuration(opts)
|
||||||
|
|
||||||
# load dict
|
# load dict
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(self.config.filename)
|
config.read(config_module.filename)
|
||||||
for each_section in config.sections():
|
for each_section in config.sections():
|
||||||
if each_section not in self.dict.keys():
|
if each_section not in self.dict.keys():
|
||||||
self.dict[each_section] = dict()
|
self.dict[each_section] = dict()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user