Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

        def start_server(settings):
    socket_list = {}

    #db = database.get_instance(settings.DATABASE)
    #db.setup()

    for name, params in settings.CHATROOMS.items():
        #name, params = db.save_room(name, params)
        bot = HermesBot(name, params)
        bot.connect()
        socket_list[bot.client.Connection._sock] = bot

    if len(socket_list.keys()) == 0:
        debug('No chatrooms defined. Exiting.')
        return

    #socket_list[sys.stdin] = 'stdio'

    while True:
        (i , o, e) = select.select(socket_list.keys(),[],[],1)
        for socket in i:
            if isinstance(socket_list[socket], HermesBot):
                socket_list[socket].client.Process(1)
            elif socket_list[socket] == 'stdio':
                msg = sys.stdin.readline().rstrip('\r\n')
                debug('stdin: %s' % (msg,))
            else:
                raise Exception("Unknown socket type: %s" % repr(socket_list[socket]))
        


src/h/e/hermes-chat-0.2.2/hermes/__init__.py   hermes-chat(Download)
from .chatserver import start_server
 
VERSION = (0, 2, 2)
VERSION_STRING = '.'.join(map(str,VERSION))