mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
test
This commit is contained in:
parent
20c03fcab2
commit
8c322c2183
@ -12,8 +12,9 @@ class BotConfig():
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.dict = {}
|
self.dict = {}
|
||||||
|
self.config = None
|
||||||
self.filename = None
|
self.filename = None
|
||||||
self.config = self.load_config()
|
self.load_config()
|
||||||
|
|
||||||
def load_config(self):
|
def load_config(self):
|
||||||
|
|
||||||
@ -24,16 +25,14 @@ class BotConfig():
|
|||||||
else:
|
else:
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
opts = parser.parse_args(argv)
|
opts = parser.parse_args(argv)
|
||||||
config_module = get_configuration(opts)
|
self.config = get_configuration(opts)
|
||||||
|
|
||||||
# Filename
|
# Filename
|
||||||
self.filename = config_module.filename
|
self.filename = self.config.filename
|
||||||
|
|
||||||
# load as dict
|
# load as dict
|
||||||
self.dict = self.config_file_to_dict()
|
self.dict = self.config_file_to_dict()
|
||||||
|
|
||||||
return config_module
|
|
||||||
|
|
||||||
def config_file_to_dict(self):
|
def config_file_to_dict(self):
|
||||||
configdict = dict()
|
configdict = dict()
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user