MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / getItem

Method getItem

service/market.py:499–523  ·  view source on GitHub ↗

Get item by its ID or name

(identity, *args, **kwargs)

Source from the content-addressed store, hash-verified

497
498 @staticmethod
499 def getItem(identity, *args, **kwargs):
500 """Get item by its ID or name"""
501 try:
502 if isinstance(identity, types_Item):
503 item = identity
504 elif isinstance(identity, int):
505 item = eos.db.getItem(identity, *args, **kwargs)
506 elif isinstance(identity, str):
507 # We normally lookup with string when we are using import/export
508 # features. Check against overrides
509 identity = conversions.all.get(identity, identity)
510 item = eos.db.getItem(identity, *args, **kwargs)
511
512 elif isinstance(identity, float):
513 id_ = int(identity)
514 item = eos.db.getItem(id_, *args, **kwargs)
515 else:
516 raise TypeError("Need Item object, integer, float or string as argument")
517 except (KeyboardInterrupt, SystemExit):
518 raise
519 except:
520 pyfalog.error("Could not get item: {0}", identity)
521 raise
522
523 return item
524
525 @staticmethod
526 def getItems(itemIDs, eager=None):

Callers 15

__init__Method · 0.95
getParentItemByItemMethod · 0.95
getVariationsByItemsMethod · 0.95
getItemsByMarketGroupMethod · 0.95
getReplacementsMethod · 0.95
getRecentlyUsedMethod · 0.95
storeRecentlyUsedMethod · 0.95
stringToImplantsMethod · 0.80
getAllFitsLiteMethod · 0.80
getRecentFitsMethod · 0.80
newFitMethod · 0.80
getSkillDescriptionMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 1