def __init__(self): super(ConnectionHandler, self).__init__() self.__tokenRequester = TokenRequester(TOKEN_TYPE.XMPPCS, ChatTokenResponse, False) self.__reconnectCallbackID = None self.__reqTokenCallbackID = None self.__connectionsInfo = ConnectionsInfo() self.__reqTokenBackOff = backoff.ExpBackoff(self.__tokenRequester.getReqCoolDown(), _BACK_OFF_MAX_DELAY, _BACK_OFF_MODIFIER, _BACK_OFF_EXP_RANDOM_FACTOR)
def __init__(self): super(URLMarcos, self).__init__() self.__macros = { 'LANGUAGE_CODE': 'getLanguageCode', 'AREA_ID': 'getAreaID', 'ENCODED_LOGIN': '******', 'QUOTED_LOGIN': '******', 'TARGET_URL': 'getTargetURL', 'DB_ID': 'getDatabaseID', 'WGNI_TOKEN': 'getWgniToken' } patterns = [] for macro in self.__macros.iterkeys(): patterns.append('\\%(macro)s\\(.*\\)|\\%(macro)s' % {'macro': self._getUserMacrosName(macro)}) self.__filter = re.compile('|'.join(patterns)) self.__argsFilter = re.compile('\\$(\\w*)(\\((.*)\\))?') self.__targetURL = '' self.__tokenRqs = TokenRequester(TOKEN_TYPE.WGNI, cache=False)
def createTokenRequester(self): return TokenRequester(TOKEN_TYPE.WGNI, cache=False)