예제 #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
파일: tap.py 프로젝트: samis/blockBox
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):
	return strports.service(config['port'], toc.TOCFactory())
예제 #5
0
def makeService(config):
    return strports.service(config['port'], toc.TOCFactory())