def makeWGInfoFromPresence(info): if "userId" in info: try: dbID = long(info["userId"]) except TypeError: LOG_CURRENT_EXCEPTION() dbID = 0 else: dbID = 0 if "nickname" in info: nickname = info["nickname"] else: nickname = "" if "extsClientTag" in info: clientInfo = WgClientHandler().handleTag(info["extsClientTag"]) else: clientInfo = None if "clanInfo" in info: clanInfo = makeClanInfo(*info["clanInfo"]) else: clanInfo = None if "banInfo" in info: banInfo = makeBanInfo(*info["banInfo"]) else: banInfo = None return WGExtsInfo(dbID, nickname, clientInfo, clanInfo, banInfo)
def makeWGInfoFromPresence(info): if 'userId' in info: try: dbID = long(info['userId']) except TypeError: LOG_CURRENT_EXCEPTION() dbID = 0 else: dbID = 0 if 'nickname' in info: nickname = info['nickname'] else: nickname = '' if 'extsClientTag' in info: clientInfo = WgClientHandler().handleTag(info['extsClientTag']) else: clientInfo = None if 'clanInfo' in info: clanInfo = makeClanInfo(*info['clanInfo']) else: clanInfo = None if 'banInfo' in info: banInfo = makeBanInfo(*info['banInfo']) else: banInfo = None return WGExtsInfo(dbID, nickname, clientInfo, clanInfo, banInfo)
def makeWGInfoFromPresence(info): if 'extsClientTag' in info: clientInfo = WgClientHandler().handleTag(info['extsClientTag']) else: clientInfo = None if 'clanInfo' in info: clanInfo = makeClanInfo(*info['clanInfo']) else: clanInfo = None if 'banInfo' in info: banInfo = makeBanInfo(*info['banInfo']) else: banInfo = None return WGExtsInfo(clientInfo, clanInfo, banInfo)