本文整理汇总了Python中stationspinner.libs.eveapihandler.EveAPIHandler.autoparseObj方法的典型用法代码示例。如果您正苦于以下问题:Python EveAPIHandler.autoparseObj方法的具体用法?Python EveAPIHandler.autoparseObj怎么用?Python EveAPIHandler.autoparseObj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stationspinner.libs.eveapihandler.EveAPIHandler
的用法示例。
在下文中一共展示了EveAPIHandler.autoparseObj方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetch_skill_in_training
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparseObj [as 别名]
def fetch_skill_in_training(apiupdate_pk):
try:
target, character = _get_character_auth(apiupdate_pk)
except CharacterSheet.DoesNotExist:
log.debug('CharacterSheet for APIUpdate {0} not indexed yet.'.format(apiupdate_pk))
return
except APIUpdate.DoesNotExist:
log.warning('Target APIUpdate {0} was deleted mid-flight.'.format(apiupdate_pk))
return
handler = EveAPIHandler()
auth = handler.get_authed_eveapi(target.apikey)
try:
api_data = auth.char.SkillInTraining(characterID=target.owner)
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(
target.apikey.keyID,
target.apikey.owner
))
target.delete()
return
obj = handler.autoparseObj(api_data,
SkillInTraining,
extra_selectors={'owner': character},
owner=character,
exclude=('currentTQTime',))
obj.currentTQTime = api_data.currentTQTime.data
obj.save()
target.updated(api_data)