From 73e6ede8cc1bd7c8a8946d3e77f5157a5177a775 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 11 Oct 2019 15:39:01 +0100 Subject: [PATCH] no longer treat ctrl+c as "shutdown" - bitbotctl will take this job --- modules/signals.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/modules/signals.py b/modules/signals.py index 336a83d3..eadf4d64 100644 --- a/modules/signals.py +++ b/modules/signals.py @@ -10,29 +10,6 @@ class Module(ModuleManager.BaseModule): def SIGINT(self, signum, frame): print() - self.bot.trigger(lambda: self._kill(signum)) - - def _kill(self, signum): - if self._exited: - return - self._exited = True - - self.events.on("signal.interrupt").call(signum=signum) - - written = False - for server in list(self.bot.servers.values()): - if server.connected: - server.socket.clear_send_buffer() - - line = utils.irc.protocol.quit("Shutting down") - sent_line = server.send(line, immediate=True) - sent_line.events.on("send").hook(self._make_hook(server)) - - server.send_enabled = False - written = True - - if not written: - sys.exit() def _make_hook(self, server): return lambda e: self.bot.disconnect(server)