def __init__(self): self.__dict__ = self.__shared_state if self.logger is None: self.logger = create_logger() # configure the bot instance if self.config is None: self.config = Config(self, self.root_path, self.default_config) else: # make sure we clear these upon reloads self.config['PLUGINS'] = [] self.config['EVENTS'] = [] self.config['REGEX'] = [] # initialize the plugin handler if self.plugin is None: self.plugin = PluginHandler(self) # initalize the reload handler if self.reloader is None: self.reloader = ReloadHandler(self)
def setUp(self): self.config = {'PLUGINS': [], 'EVENTS': [], 'MIN_WORKERS': 3} self.logger = None self.thread_pool = None self.plugins = PluginHandler(self.config, self.logger, self.thread_pool)