Пример #1
0
def makeService(config):
    port, user, password = config['port'], config['user'], config['password']
    p = portal.Portal(
        service.Realm(
            service.Service(config["tracebacks"], config.get('namespace'))),
        [checkers.InMemoryUsernamePasswordDatabaseDontUse(**{user: password})])
    return strports.service(port, pb.PBServerFactory(p, config["tracebacks"]))
Пример #2
0
def getPorts(app, config):
    svc = service.Service(application=app)
    p = svc.createPerspective(config.user)
    p.makeIdentity(config.password)
    try:
        portno = config.portno
    except AttributeError:
        portno = pb.portno
    return [(portno, pb.BrokerFactory(pb.AuthRoot(app)))]
Пример #3
0
 def setUp(self):
     self.service = service.Service()
     self.p = service.Perspective(self.service)
     self.client = DummyManholeClient()
     self.p.attached(self.client, None)
Пример #4
0
 def setUp(self):
     self.service = service.Service(application=DummyApp())
     self.p = service.Perspective("UnitTest")
     self.p.setService(self.service)
     self.client = DummyManholeClient()
     self.p.attached(self.client, None)