def makeService(config): router = component.Router() factory = component.XMPPComponentServerFactory(router, config['secret']) if config['verbose']: factory.logTraffic = True return strports.service(config['port'], factory)
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
def makeService(config): return strports.service(config['port'], toc.TOCFactory())