コード例 #1
0
ファイル: wg_items.py プロジェクト: webiumsk/WOT-0.9.14-CT
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)
コード例 #2
0
ファイル: wg_items.py プロジェクト: webiumsk/WOT-0.9.17-CT
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)
コード例 #3
0
ファイル: wg_items.py プロジェクト: webiumsk/WOT-0.9.15-CT
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)
コード例 #4
0
ファイル: wg_items.py プロジェクト: webiumsk/WOT0.9.10
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)
コード例 #5
0
ファイル: wg_items.py プロジェクト: jamesxia4/wot_client
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)