本文整理汇总了Python中stationspinner.libs.eveapihandler.EveAPIHandler.invalidate_entity方法的典型用法代码示例。如果您正苦于以下问题:Python EveAPIHandler.invalidate_entity方法的具体用法?Python EveAPIHandler.invalidate_entity怎么用?Python EveAPIHandler.invalidate_entity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stationspinner.libs.eveapihandler.EveAPIHandler
的用法示例。
在下文中一共展示了EveAPIHandler.invalidate_entity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetch_assetlist
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import invalidate_entity [as 别名]
def fetch_assetlist(apiupdate_pk):
try:
target, corporation = _get_corporation_auth(apiupdate_pk)
except CorporationSheet.DoesNotExist:
log.debug("CorporationSheet 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(corporation.owner_key)
try:
api_data = auth.corp.AssetList(characterID=corporation.owner_key.characterID)
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
assetlist = AssetList(owner=corporation, retrieved=api_data._meta.currentTime)
assetlist.items = handler.asset_parser(api_data.assets, Asset, corporation)
assetlist.save()
handler = CorporationAssetHandler()
handler.invalidate_entity(corporation.pk)
target.updated(api_data)
示例2: len
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import invalidate_entity [as 别名]
owner=corporation,
pre_save=True)
names_registered += len(IDs)
old_names = ItemLocationName.objects.filter(owner=corporation).exclude(pk__in=itemIDs_with_names)
log.debug('Fetched {0} names and deleted {1} for "{2}"'.format(
names_registered,
old_names.count(),
corporation
))
old_names.delete()
for asset in Asset.objects.filter(owner=corporation):
asset.update_search_tokens()
handler = CorporationAssetHandler()
handler.invalidate_entity(corporation.pk)
target.updated(api_data)
@app.task(name='corporation.fetch_membertracking', max_retries=0)
def fetch_membertracking(apiupdate_pk):
try:
target, corporation = _get_corporation_auth(apiupdate_pk)
except CorporationSheet.DoesNotExist:
log.debug('CorporationSheet 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()