started removing bullshit magic

This commit is contained in:
Luke Rogers 2013-10-02 13:33:17 +13:00
parent c6fd9e1f55
commit 7e4ea3a9ff
6 changed files with 44 additions and 59 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
# we import bot as _bot for now, for legacy reasons
from core import bot as _bot
from core import loader, main
import os
import Queue
@ -16,20 +17,14 @@ print 'CloudBot REFRESH <http://git.io/cloudbotirc>'
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)
bot.logger.debug("Starting main loop.")
while True:
reload() # these functions only do things
loader.reload(bot) # these functions only do things
for connection in bot.connections.itervalues():
try:
out = connection.out.get_nowait()
main(connection, out)
main.main(bot, connection, out)
except Queue.Empty:
pass
while all(connection.out.empty() for connection in bot.connections.itervalues()):