(self, implant)
| 259 | HandledList.insert(self, idx, implant) |
| 260 | |
| 261 | def makeRoom(self, implant): |
| 262 | # if needed, remove booster that was occupying slot |
| 263 | oldObj = next((i for i in self if i.slot == implant.slot), None) |
| 264 | if oldObj is not None: |
| 265 | pyfalog.info("Slot {0} occupied with {1}, replacing with {2}", implant.slot, oldObj.item.name, implant.item.name) |
| 266 | position = self.index(oldObj) |
| 267 | from gui.fitCommands.helpers import ImplantInfo |
| 268 | implantInfo = ImplantInfo.fromImplant(oldObj) |
| 269 | oldObj.itemID = 0 # hack to remove from DB. See GH issue #324 |
| 270 | self.remove(oldObj) |
| 271 | return position, implantInfo |
| 272 | return None, None |
| 273 | |
| 274 | def __slotCheck(self, implant): |
| 275 | return any(i.slot == implant.slot for i in self) |
no test coverage detected