本文整理匯總了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)