Ejemplo n.º 1
0
def setup():
    global memory_db
    if not memory_db == None:
        return
    memory_db = TestConnection()
    db.setup_connection_factory(memory_db.get_connection, memory_db.done_connection)
    db.setup_db('admin', 'password')
Ejemplo n.º 2
0
    def __init__(self, settings):
        db.setup_connection_factory(create_connection, close_connection)

        self.settings = settings

        self.connection = connection.Connection(self.settings["host"], self.settings["port"])
        self.connection.handshake(self.settings["nick"])
        self.plugins = [core.Core(self.connection, self.settings)]
        self.plugins.extend(plugin.load_plugins(self.connection))