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)
Exemplo n.º 3
0
    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 == {}
Exemplo n.º 5
0
	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()
Exemplo n.º 6
0
    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()
Exemplo n.º 7
0
    def disconnect(self):
        """Disconnects from the IRC server."""

        self.send_data("QUIT :Disconnecting")
        modules.shutdown(self.msg_parser)
        self.close()