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

Class Section

service/port/eft.py:686–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684
685
686class Section:
687
688 def __init__(self):
689 self.lines = []
690 self.itemSpecs = []
691 self.__itemDataCats = None
692
693 @property
694 def itemDataCats(self):
695 if self.__itemDataCats is None:
696 cats = set()
697 for itemSpec in self.itemSpecs:
698 if itemSpec is None:
699 continue
700 cats.add(itemSpec.item.category.name)
701 self.__itemDataCats = tuple(sorted(cats))
702 return self.__itemDataCats
703
704 @property
705 def isModuleRack(self):
706 return all(i is None or i.isModule for i in self.itemSpecs)
707
708 @property
709 def isImplantRack(self):
710 return all(i is not None and i.isImplant for i in self.itemSpecs)
711
712 @property
713 def isDroneBay(self):
714 return all(i is not None and i.isDrone for i in self.itemSpecs)
715
716 @property
717 def isFighterBay(self):
718 return all(i is not None and i.isFighter for i in self.itemSpecs)
719
720 @property
721 def isCargoHold(self):
722 return (
723 all(i is not None and i.isCargo for i in self.itemSpecs) and
724 not self.isDroneBay and not self.isFighterBay)
725
726
727class BaseItemSpec:

Callers 1

_importSectionIterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected