Get group by its ID or name
(self, identity, *args, **kwargs)
| 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): |
no outgoing calls
no test coverage detected