restructured IRC engine (this does not work yet)
This commit is contained in:
parent
1cc38cb139
commit
7c399db0ea
6 changed files with 189 additions and 111 deletions
15
cloudbot.py
15
cloudbot.py
|
@ -4,16 +4,25 @@ from core import bot as _bot
|
|||
|
||||
import os
|
||||
import sys
|
||||
import signal
|
||||
|
||||
# set up enviroment
|
||||
os.chdir(sys.path[0] or '.') # do stuff relative to the install directory
|
||||
|
||||
print 'CloudBot REFRESH <http://git.io/cloudbotirc>'
|
||||
|
||||
def exit_gracefully(signum, frame):
|
||||
bot.stop()
|
||||
|
||||
# store the original SIGINT handler
|
||||
original_sigint = signal.getsignal(signal.SIGINT)
|
||||
signal.signal(signal.SIGINT, exit_gracefully)
|
||||
|
||||
# create new bot object
|
||||
bot = _bot.Bot("cloudbot")
|
||||
bot.logger.debug("Bot initalized.")
|
||||
bot.logger.debug("Bot initalized, starting main loop.")
|
||||
|
||||
bot.logger.debug("Starting main loop.")
|
||||
while True:
|
||||
while bot.running:
|
||||
bot.loop()
|
||||
|
||||
bot.logger.debug("Stopped main loop.")
|
||||
|
|
Reference in a new issue