Initialize a module from the database and validate
(self)
| 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 """ |
nothing calls this directly
no test coverage detected