示例#1
0
 def __init__(self, id):
     self.id = id
     cfg = self.__cfg()
     self.host = nvl(cfg.main.host, 'localhost')
     self.port = int(nvl(cfg.main.port, 443))
     self.auth = self.__auth(cfg)
     self.root = nvl(cfg.main.root)
示例#2
0
 def __auth(self, cfg):
     auth = nvl(cfg.main.auth)
     if not auth:
         return NoAuth()
     if auth == 'basic':
         basic = cfg.basic
         return Basic(basic.user, basic.password)
示例#3
0
 def __init(cls, url):
     b = Broker(url)
     b.cacert = nvl(cfg.broker.cacert)
     b.clientcert = nvl(cfg.broker.clientcert)