當前位置: 首頁>>代碼示例>>Python>>正文


Python EveAPIHandler.invalidate_entity方法代碼示例

本文整理匯總了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)
開發者ID:roxlukas,項目名稱:stationspinner,代碼行數:28,代碼來源:tasks.py

示例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()
開發者ID:eve-armada,項目名稱:stationspinner,代碼行數:33,代碼來源:tasks.py


注:本文中的stationspinner.libs.eveapihandler.EveAPIHandler.invalidate_entity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。