bing bong
This commit is contained in:
parent
a78a86602d
commit
6ff926246b
4 changed files with 6 additions and 7 deletions
|
@ -99,7 +99,7 @@ class Bot(threading.Thread):
|
||||||
"""create the logger and config objects"""
|
"""create the logger and config objects"""
|
||||||
# logging
|
# logging
|
||||||
self.logger = get_logger()
|
self.logger = get_logger()
|
||||||
self.logger.debug("Logging system ready.")
|
self.logger.debug("Logging system initalised.")
|
||||||
|
|
||||||
# data folder
|
# data folder
|
||||||
self.data_dir = os.path.abspath('persist')
|
self.data_dir = os.path.abspath('persist')
|
||||||
|
@ -109,13 +109,13 @@ class Bot(threading.Thread):
|
||||||
|
|
||||||
# config
|
# config
|
||||||
self.config = config.Config(self)
|
self.config = config.Config(self)
|
||||||
self.logger.debug("Config system ready.")
|
self.logger.debug("Config system initalised.")
|
||||||
|
|
||||||
# db
|
# db
|
||||||
engine = create_engine('sqlite:///cloudbot.db')
|
engine = create_engine('sqlite:///cloudbot.db')
|
||||||
db_factory = sessionmaker(bind=engine)
|
db_factory = sessionmaker(bind=engine)
|
||||||
self.db_session = scoped_session(db_factory)
|
self.db_session = scoped_session(db_factory)
|
||||||
self.logger.debug("Database system ready.")
|
self.logger.debug("Database system initalised.")
|
||||||
|
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
|
|
|
@ -50,7 +50,6 @@ class Config(dict):
|
||||||
|
|
||||||
def watcher(self):
|
def watcher(self):
|
||||||
"""starts the watchdog to automatically reload the config when it changes on disk"""
|
"""starts the watchdog to automatically reload the config when it changes on disk"""
|
||||||
self.logger.debug("Starting config reloader.")
|
|
||||||
self.observer = Observer()
|
self.observer = Observer()
|
||||||
|
|
||||||
pattern = "*{}".format(self.filename)
|
pattern = "*{}".format(self.filename)
|
||||||
|
|
|
@ -95,8 +95,8 @@ class PluginLoader(object):
|
||||||
for type, data in obj._hook:
|
for type, data in obj._hook:
|
||||||
# add plugin to the plugin list
|
# add plugin to the plugin list
|
||||||
self.bot.plugins[type] += [data]
|
self.bot.plugins[type] += [data]
|
||||||
if not loaded_all:
|
#if not loaded_all:
|
||||||
self.bot.logger.info("Loaded plugin: {} ({})".format(format_plug(data), type))
|
self.bot.logger.info("Loaded plugin: {} ({})".format(format_plug(data), type))
|
||||||
|
|
||||||
# do a rebuild, unless the bot is loading all plugins (rebuild happens after load_all)
|
# do a rebuild, unless the bot is loading all plugins (rebuild happens after load_all)
|
||||||
if not loaded_all:
|
if not loaded_all:
|
||||||
|
|
|
@ -204,4 +204,4 @@ def main(bot, conn, out):
|
||||||
input = Input(bot, conn, *out)
|
input = Input(bot, conn, *out)
|
||||||
input.inp = m
|
input.inp = m
|
||||||
|
|
||||||
dispatch(input, "regex", func, args)
|
dispatch(bot, input, "regex", func, args)
|
||||||
|
|
Reference in a new issue