Make sys exit optional

This commit is contained in:
dpedu 2015-08-30 23:23:09 -07:00
parent 05cce26a52
commit 2e25a7ed04
1 changed files with 3 additions and 2 deletions

View File

@ -68,14 +68,15 @@ class PyIRCBot:
def loop(self): def loop(self):
self.irc.loop() self.irc.loop()
def kill(self): def kill(self, sys_exit=True):
"""Shut down the bot violently""" """Shut down the bot violently"""
#Close all modules #Close all modules
self.closeAllModules() self.closeAllModules()
self.irc.kill() self.irc.kill()
sys.exit(0) if sys_exit:
sys.exit(0)
def connection_closed(self, args, prefix, trailing): def connection_closed(self, args, prefix, trailing):
"""Called when the socket is disconnected. We will want to reconnect. """ """Called when the socket is disconnected. We will want to reconnect. """