def test_include(): import modules reload(modules) parser = parser.parser() modules.startup(parser) assert modules.modules.keys()[0] == 'admin_disconnect' modules.shutdown(parser)
def test_includes_excludes_both_not_empty(): import modules reload(modules) parser = parser.parser() modules.startup(parser) assert modules.modules == {} modules.shutdown(parser)
def handle_close(self): """Called when the socket is closed.""" logging.info('Saving channels') modules.shutdown(self.msg_parser) self.close() exit()
def test_startup_shutdown(): import modules parser = parser.parser() assert modules.modules == {} modules.startup(parser) assert modules.modules != {} modules.shutdown(parser) assert modules.modules == {}
def onDisconnected(self): modules.fire_hook("disconnected", self) IrcClient.onDisconnected(self) global connections connections -= 1 if connections == 0: self.logger.info("Shutting down.") modules.shutdown()
def disconnect(self): """Disconnects from the IRC server.""" self.send_data("QUIT :Disconnecting") modules.shutdown(self.msg_parser) self.close()