示例#1
0
文件: character.py 项目: tiniumv/Pyfa
    def apiCharList(self, charID, userID, apiKey):
        char = eos.db.getCharacter(charID)

        char.apiID = userID
        char.apiKey = apiKey

        api = service.EVEAPIConnection()
        auth = api.auth(keyID=userID, vCode=apiKey)
        apiResult = auth.account.Characters()
        charList = map(lambda c: unicode(c.name), apiResult.characters)

        char.chars = json.dumps(charList)
        return charList
示例#2
0
文件: character.py 项目: tiniumv/Pyfa
    def apiFetch(self, charID, charName):
        dbChar = eos.db.getCharacter(charID)
        dbChar.defaultChar = charName

        api = service.EVEAPIConnection()
        auth = api.auth(keyID=dbChar.apiID, vCode=dbChar.apiKey)
        apiResult = auth.account.Characters()
        charID = None
        for char in apiResult.characters:
            if char.name == charName:
                charID = char.characterID

        if charID == None:
            return

        sheet = auth.character(charID).CharacterSheet()

        dbChar.apiUpdateCharSheet(sheet.skills)
        eos.db.commit()