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

Method getGroup

service/market.py:530–546  ·  view source on GitHub ↗

Get group by its ID or name

(self, identity, *args, **kwargs)

Source from the content-addressed store, hash-verified

528 return items
529
530 def getGroup(self, identity, *args, **kwargs):
531 """Get group by its ID or name"""
532 if isinstance(identity, types_Group):
533 return identity
534 elif isinstance(identity, (int, float, str)):
535 if isinstance(identity, float):
536 identity = int(identity)
537 # Check custom groups
538 for cgrp in self.customGroups:
539 # During first comparison we need exact int, not float for matching
540 if cgrp.ID == identity or cgrp.name == identity:
541 # Return first match
542 return cgrp
543 # Return eos group if everything else returned nothing
544 return eos.db.getGroup(identity, *args, **kwargs)
545 else:
546 raise TypeError("Need Group object, integer, float or string as argument")
547
548 @staticmethod
549 def getCategory(identity, *args, **kwargs):

Callers 10

__init__Method · 0.95
getShipListMethod · 0.95
getSkillsMethod · 0.80
AddCommandFitClass · 0.80
getEffectBeaconsMethod · 0.80
getAbyssalWeatherMethod · 0.80
groupIDCallbackMethod · 0.80
groupIDCallbackMethod · 0.80
__getModeItemsMethod · 0.80
getValidChargesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected