^-^
This commit is contained in:
parent
74f1fcf529
commit
88304ff795
2 changed files with 7 additions and 11 deletions
14
cloudbot.py
14
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 <http://git.io/cloudbotirc>'
|
||||
print 'CloudBot REFRESH <http://git.io/cloudbotirc>'
|
||||
|
||||
# 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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Reference in a new issue