|
@@ -298,11 +298,12 @@ class LocationBot(ircbot.SingleServerIRCBot):
|
|
|
else:
|
|
|
connection.privmsg(nick, 'not in channel ("%s")' % channel)
|
|
|
|
|
|
- def __quit(self, connection, nick):
|
|
|
+ def __quit(self, connection, nick, arguments):
|
|
|
self.__reloading = True
|
|
|
self.__quiting = True
|
|
|
|
|
|
connection.privmsg(nick, 'quiting')
|
|
|
+ self.disconnect(arguments)
|
|
|
|
|
|
def __register(self, connection, nick, arguments):
|
|
|
arguments = arguments.split(None, 1)
|
|
@@ -578,7 +579,7 @@ class LocationBot(ircbot.SingleServerIRCBot):
|
|
|
elif admin and command == 'part':
|
|
|
self.__part(connection, nick, arguments)
|
|
|
elif admin and command == 'quit':
|
|
|
- self.__quit(connection, nick)
|
|
|
+ self.__quit(connection, nick, arguments)
|
|
|
elif admin and command == 'reload':
|
|
|
self.__reload(connection, nick)
|
|
|
elif admin and command == 'restart':
|
|
@@ -646,6 +647,8 @@ def _or(function, values):
|
|
|
return reduce(lambda a, b: a or b, map(function, values) if values else [False])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
+ os.chdir(os.path.abspath(os.path.dirname(__file__)))
|
|
|
+
|
|
|
pid = os.fork()
|
|
|
|
|
|
if pid != 0:
|
|
@@ -671,7 +674,6 @@ if __name__ == '__main__':
|
|
|
else:
|
|
|
bot.success()
|
|
|
except KeyboardInterrupt:
|
|
|
- pass
|
|
|
+ bot.disconnect()
|
|
|
|
|
|
- bot.disconnect()
|
|
|
os.unlink('locationbot.pid')
|