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

Method init

eos/saveddata/module.py:91–117  ·  view source on GitHub ↗

Initialize a module from the database and validate

(self)

Source from the content-addressed store, hash-verified

89
90 @reconstructor
91 def init(self):
92 """Initialize a module from the database and validate"""
93 self._item = None
94 self.__charge = None
95
96 # we need this early if module is invalid and returns early
97 self.__slot = self.dummySlot
98
99 if self.itemID:
100 self._item = eos.db.getItem(self.itemID)
101 if self._item is None:
102 pyfalog.error("Item (id: {0}) does not exist", self.itemID)
103 return
104
105 try:
106 self._mutaReconstruct()
107 except MutaError:
108 return
109
110 if self.isInvalid:
111 pyfalog.error("Item (id: {0}) is not a Module", self.itemID)
112 return
113
114 if self.chargeID:
115 self.__charge = eos.db.getItem(self.chargeID)
116
117 self.build()
118
119 def build(self):
120 """ Builds internal module variables from both init's """

Callers

nothing calls this directly

Calls 3

buildMethod · 0.95
getItemMethod · 0.80
_mutaReconstructMethod · 0.80

Tested by

no test coverage detected