本文整理汇总了Python中stationspinner.libs.eveapihandler.EveAPIHandler.autoparse_list方法的典型用法代码示例。如果您正苦于以下问题:Python EveAPIHandler.autoparse_list方法的具体用法?Python EveAPIHandler.autoparse_list怎么用?Python EveAPIHandler.autoparse_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stationspinner.libs.eveapihandler.EveAPIHandler
的用法示例。
在下文中一共展示了EveAPIHandler.autoparse_list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetch_marketorders
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_marketorders(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(target.apikey)
try:
api_data = auth.corp.MarketOrders()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
handler.autoparse_list(
api_data.orders,
MarketOrder,
unique_together=("orderID",),
extra_selectors={"owner": corporation},
owner=corporation,
)
target.updated(api_data)
corporation_market_orders_updated.send(MarketOrder, corporationID=corporation.pk)
示例2: fetch_industryjobshistory
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_industryjobshistory(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.IndustryJobsHistory(characterID=target.owner)
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(
target.apikey.keyID,
target.apikey.owner
))
target.delete()
return
handler.autoparse_list(api_data.jobs,
IndustryJobHistory,
unique_together=('jobID',),
extra_selectors={'owner': character},
owner=character)
target.updated(api_data)
character_industry_jobs_history_updated.send(IndustryJobHistory, characterID=character.pk)
示例3: fetch_membersecuritylog
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_membersecuritylog(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(target.apikey)
try:
api_data = auth.corp.MemberSecurityLog()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
handler.autoparse_list(
api_data.roleHistory,
MemberSecurityLog,
unique_together=("changeTime", "characterID", "roleLocationType"),
extra_selectors={"owner": corporation},
owner=corporation,
immutable=True,
)
target.updated(api_data)
corporation_member_security_log_updated.send(MemberSecurityLog, corporationID=corporation.pk)
示例4: fetch_wallettransactions
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_wallettransactions(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.WalletTransactions(characterID=target.owner, rowCount=2560)
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(
target.apikey.keyID,
target.apikey.owner
))
target.delete()
return
handler.autoparse_list(api_data.transactions,
WalletTransaction,
unique_together=('transactionID',),
extra_selectors={'owner': character},
owner=character,
exclude=['transactionType', 'transactionFor'],
pre_save=True)
target.updated(api_data)
示例5: fetch_accountbalance
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_accountbalance(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.AccountBalance(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
handler.autoparse_list(api_data.accounts,
AccountBalance,
unique_together=('accountKey',),
extra_selectors={'owner': corporation},
owner=corporation,
pre_save=True)
target.updated(api_data)
示例6: fetch_npcstandings
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_npcstandings(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(target.apikey)
try:
api_data = auth.corp.Standings()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
agent_ids = handler.autoparse_list(
api_data.corporationNPCStandings.agents,
NPCStanding,
unique_together=("fromID",),
extra_selectors={"owner": corporation},
owner=corporation,
static_defaults={"type": "Agent"},
)
corp_ids = handler.autoparse_list(
api_data.corporationNPCStandings.NPCCorporations,
NPCStanding,
unique_together=("fromID",),
extra_selectors={"owner": corporation},
owner=corporation,
static_defaults={"type": "Corporation"},
)
faction_ids = handler.autoparse_list(
api_data.corporationNPCStandings.factions,
NPCStanding,
unique_together=("fromID",),
extra_selectors={"owner": corporation},
owner=corporation,
static_defaults={"type": "Faction"},
)
all_ids = agent_ids + corp_ids + faction_ids
NPCStanding.objects.filter(owner=corporation).exclude(pk__in=all_ids).delete()
target.updated(api_data)
corporation_npc_standings_updated.send(NPCStanding, corporationID=corporation.pk)
示例7: fetch_shareholders
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_shareholders(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(target.apikey)
try:
api_data = auth.corp.ShareHolders()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
char_ids = handler.autoparse_list(
api_data.characters,
Shareholder,
unique_together=("shareholderID", "holder_type"),
extra_selectors={"owner": corporation},
owner=corporation,
static_defaults={"holder_type": "Character"},
)
corp_ids = handler.autoparse_list(
api_data.corporations,
Shareholder,
unique_together=("shareholderID", "holder_type"),
extra_selectors={"owner": corporation},
owner=corporation,
static_defaults={"holder_type": "Corporation"},
)
old_entries = Shareholder.objects.filter(owner=corporation).exclude(pk__in=char_ids + corp_ids)
deleted = old_entries.count()
old_entries.delete()
log.info(
'Updated shareholders for corporation "{0}". {1} entries, {2} old entries removed.'.format(
corporation, len(corp_ids) + len(char_ids), deleted
)
)
target.updated(api_data)
corporation_shareholders_updated.send(Shareholder, corporationID=corporation.pk)
示例8: fetch_apicalls
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_apicalls():
handler = EveAPIHandler()
api = handler.get_eveapi()
apiData = api.api.CallList()
cgIDs = handler.autoparse_list(apiData.callGroups,
APICallGroup,
unique_together=('groupID',),
pre_save=True)
cIDs = handler.autoparse_list(apiData.calls,
APICall,
unique_together=('accessMask', 'type'),
pre_save=True)
log.info('Added {0} call groups and {1} calls.'.format(cgIDs, cIDs))
update, created = UniverseUpdate.objects.get_or_create(apicall='CallList')
update.updated(apiData)
示例9: fetch_contractbids
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_contractbids(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(target.apikey)
try:
api_data = auth.corp.ContractBids()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
bid_ids, overlap = handler.autoparse_list(
api_data.bidList,
ContractBid,
unique_together=("contractID", "bidID"),
extra_selectors={"owner": corporation},
owner=corporation,
immutable=True,
)
target.updated(api_data)
# Only trigger if there are new bids
for bid in ContractBid.objects.filter(pk__in=bid_ids):
corporation_contract_bids_new_bid.send(
ContractBid, corporationID=corporation.pk, contractID=bid.contractID, bid_pk=bid.pk
)
corporation_contract_bids_updated.send(ContractBid, corporationID=corporation.pk)
示例10: fetch_contracts
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_contracts(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(target.apikey)
try:
api_data = auth.corp.Contracts()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
contract_ids = handler.autoparse_list(
api_data.contractList,
Contract,
unique_together=("contractID",),
extra_selectors={"owner": corporation},
owner=corporation,
)
target.updated(api_data)
corporation_contracts_updated.send(Contract, corporationID=corporation.pk)
for id in contract_ids:
contract = Contract.objects.get(pk=id)
if contract.get_items().count() == 0:
app.send_task("corporation.fetch_contractitems", [target.pk, contract.pk])
示例11: fetch_skillqueue
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_skillqueue(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.SkillQueue(characterID=target.owner)
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(
target.apikey.keyID,
target.apikey.owner
))
target.delete()
return
skills = handler.autoparse_list(api_data.skillqueue,
SkillQueue,
unique_together=('typeID', 'level'),
extra_selectors={'owner': character},
owner=character,
pre_save=True)
SkillQueue.objects.filter(owner=character).exclude(pk__in=skills).delete()
target.updated(api_data)
示例12: fetch_blueprints
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_blueprints(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.Blueprints(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
blueprintsIDs = handler.autoparse_list(api_data.blueprints,
Blueprint,
unique_together=('itemID',),
extra_selectors={'owner': corporation},
owner=corporation,
pre_save=True)
Blueprint.objects.filter(owner=corporation) \
.exclude(pk__in=blueprintsIDs).delete()
target.updated(api_data)
示例13: fetch_starbaselist
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_starbaselist(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.StarbaseList(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
posIDs = handler.autoparse_list(
api_data.starbases,
Starbase,
unique_together=("itemID",),
extra_selectors={"owner": corporation},
owner=corporation,
pre_save=True,
)
Starbase.objects.filter(owner=corporation).exclude(pk__in=posIDs).delete()
target.updated(api_data)
示例14: fetch_outpostservicedetails
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_outpostservicedetails(apiupdate_pk, stationID):
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(target.apikey)
try:
api_data = auth.corp.OutpostServiceDetail(itemID=stationID)
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
outpost_services_ids = handler.autoparse_list(
api_data.outpostServiceDetails,
OutpostService,
unique_together=("stationID", "serviceName"),
extra_selectors={"owner": corporation},
owner=corporation,
)
OutpostService.objects.filter(owner=corporation).exclude(pk__in=outpost_services_ids).delete()
target.updated(api_data)
corporation_outpost_services_updated.send(OutpostService, corporationID=corporation.pk, stationID=stationID)
示例15: fetch_facilities
# 需要导入模块: from stationspinner.libs.eveapihandler import EveAPIHandler [as 别名]
# 或者: from stationspinner.libs.eveapihandler.EveAPIHandler import autoparse_list [as 别名]
def fetch_facilities(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(target.apikey)
try:
api_data = auth.corp.Facilities()
except AuthenticationError:
log.error('AuthenticationError for key "{0}" owned by "{1}"'.format(target.apikey.keyID, target.apikey.owner))
target.delete()
return
facility_ids = handler.autoparse_list(
api_data.facilities,
Facility,
unique_together=("facilityID",),
extra_selectors={"owner": corporation},
owner=corporation,
)
Facility.objects.filter(owner=corporation).exclude(pk__in=facility_ids).delete()
target.updated(api_data)
corporation_facilities_updated.send(Facility, corporationID=corporation.pk)