Пример #1
0
def makeService(config):
    router = component.Router()
    factory = component.XMPPComponentServerFactory(router, config['secret'])

    if config['verbose']:
        factory.logTraffic = True

    return strports.service(config['port'], factory)
Пример #2
0
def makeService(config):
    router = component.Router()
    factory = component.XMPPComponentServerFactory(router, config['secret'])

    if config['verbose']:
        factory.logTraffic = True

    return strports.service(config['port'], factory)
Пример #3
0
def makeService(config):
    credCheckers = config.get('credCheckers', [])
    wordsRealm = service.InMemoryWordsRealm(config['hostname'])
    wordsPortal = portal.Portal(wordsRealm, credCheckers)

    msvc = MultiService()

    # XXX Attribute lookup on config is kind of bad - hrm.
    for plgName in config.interfacePlugins:
        port = config.get(plgName + '-port')
        if port is not None:
            factory = config.interfacePlugins[plgName].getFactory(wordsRealm, wordsPortal)
            svc = strports.service(port, factory)
            svc.setServiceParent(msvc)

    # This is bogus.  createGroup is async.  makeService must be
    # allowed to return a Deferred or some crap.
    for g in config['groups']:
        wordsRealm.createGroup(g)

    return msvc
Пример #4
0
def makeService(config):
    credCheckers = config.get('credCheckers', [])
    wordsRealm = service.InMemoryWordsRealm(config['hostname'])
    wordsPortal = portal.Portal(wordsRealm, credCheckers)

    msvc = MultiService()

    # XXX Attribute lookup on config is kind of bad - hrm.
    for plgName in config.interfacePlugins:
        port = config.get(plgName + '-port')
        if port is not None:
            factory = config.interfacePlugins[plgName].getFactory(
                wordsRealm, wordsPortal)
            svc = strports.service(port, factory)
            svc.setServiceParent(msvc)

    # This is bogus.  createGroup is async.  makeService must be
    # allowed to return a Deferred or some crap.
    for g in config['groups']:
        wordsRealm.createGroup(g)

    return msvc
Пример #5
0
def makeService(config):
    return strports.service(config['port'], toc.TOCFactory())
Пример #6
0
def makeService(config):
    return strports.service(config['port'], toc.TOCFactory())