From e07e82b9dd93c97e53521f9fcdc967febf8d0eeb Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Wed, 15 Jun 2022 12:05:51 -0500 Subject: Added bot's code --- src/config.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/config.py') diff --git a/src/config.py b/src/config.py index 4191c4d..0c4916d 100644 --- a/src/config.py +++ b/src/config.py @@ -2,15 +2,26 @@ import configparser class Config: """ - A cconfig reader class. + A config reader class. """ def __init__(self, config_file): self._parser = configparser.ConfigParser() self._parser.read(config_file) - def get_server_config(self): - host = self._parser['Server']['host'] - version = self._parser['Server']['api_version'] + # Mumble config + def get_mumble_config(self, ): + host = self._parser['MumbleServer']['host'] + password = self._parser['MumbleServer']['password'] + certfile = self._parser['MumbleServer']['certfile'] + keyfile = self._parser['MumbleServer']['keyfile'] + name = self._parser['MumbleServer']['name'] + + return (host, password, certfile, keyfile, name) + + # Ampache config + def get_ampache_config(self): + host = self._parser['AmpacheServer']['host'] + version = self._parser['AmpacheServer']['api_version'] return (host, version) @@ -20,8 +31,8 @@ class Config: return auth def get_directories(self): - download = self._parser['Directories']['download_folder'] - delete_after_playing = bool(self._parser['Directories'] + download = self._parser['Misc']['download_folder'] + delete_after_playing = bool(self._parser['Misc'] ['delete_after_playing']) return (download, delete_after_playing) -- cgit v1.2.3