From 88304ff795f11bef54d9d1480773b4b9ad424176 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Tue, 1 Oct 2013 20:46:58 +1300 Subject: [PATCH] ^-^ --- cloudbot.py | 14 +++++--------- core/bot.py | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cloudbot.py b/cloudbot.py index 3c9b76b..4afaa11 100644 --- a/cloudbot.py +++ b/cloudbot.py @@ -5,31 +5,27 @@ from core import bot as _bot import os import Queue import sys -import re import time -sys.path += ['plugins', 'lib', 'core'] # add stuff to the sys.path for easy imports +# set up enviroment +sys.path += ['plugins', 'lib'] # add stuff to the sys.path for easy imports os.chdir(sys.path[0] or '.') # do stuff relative to the install directory -print 'CloudBot DEV ' +print 'CloudBot REFRESH ' # create new bot object bot = _bot.Bot("cloudbot") bot.logger.debug("Bot initalized.") # bootstrap the reloader +bot.logger.debug("Bootstrapping reloader.") eval(compile(open(os.path.join('core', 'reload.py'), 'U').read(), os.path.join('core', 'reload.py'), 'exec')) reload(init=True) - - - -print 'Connection(s) made, starting main loop.' - +bot.logger.debug("Starting main loop.") while True: reload() # these functions only do things - # if changes have occured for connection in bot.connections.itervalues(): try: diff --git a/core/bot.py b/core/bot.py index b3f20d7..1f120f4 100644 --- a/core/bot.py +++ b/core/bot.py @@ -87,8 +87,8 @@ class Bot(object): # create a formatter and set the formatter for the handler. frmt = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s') fh.setFormatter(frmt) - simplefrmt = logging.Formatter('[%(levelname)s] %(message)s') - sh.setFormatter(simplefrmt) + simple_frmt = logging.Formatter('[%(levelname)s] %(message)s') + sh.setFormatter(simple_frmt) # add the Handlers to the logger logger.addHandler(fh)