33 lines
705 B
Python
33 lines
705 B
Python
|
from configparser import ConfigParser
|
||
|
|
||
|
from .module import Config
|
||
|
|
||
|
|
||
|
CONFIG_FILE = 'config.ini'
|
||
|
|
||
|
|
||
|
class Configure(Config):
|
||
|
|
||
|
def __init__(self):
|
||
|
|
||
|
self.config = ConfigParser()
|
||
|
self.data = dict()
|
||
|
self.__readconfig()
|
||
|
|
||
|
def __readconfig(self):
|
||
|
self.config.read(CONFIG_FILE)
|
||
|
for section in self.config.sections():
|
||
|
self.data[section] = dict()
|
||
|
|
||
|
for (key, value) in self.config.items(section):
|
||
|
self.data[section][key] = value
|
||
|
|
||
|
def bot(self, key):
|
||
|
return self.data["Bot"][key]
|
||
|
|
||
|
def db(self, key):
|
||
|
return self.data["DataBase"][key]
|
||
|
|
||
|
def anons(self, key):
|
||
|
return self.data["announcements"][key]
|