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

Method toDrone

gui/fitCommands/helpers.py:190–212  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 return info
189
190 def toDrone(self):
191 mkt = Market.getInstance()
192 item = mkt.getItem(self.itemID, eager=('attributes', 'group.category'))
193 if self.baseItemID and self.mutaplasmidID:
194 baseItem = mkt.getItem(self.baseItemID, eager=('attributes', 'group.category'))
195 mutaplasmid = eos.db.getDynamicItem(self.mutaplasmidID)
196 else:
197 baseItem = None
198 mutaplasmid = None
199 try:
200 drone = Drone(item, baseItem=baseItem, mutaplasmid=mutaplasmid)
201 except ValueError:
202 pyfalog.warning('Invalid item: {}'.format(self.itemID))
203 return None
204
205 if self.mutations is not None:
206 for attrID, mutator in drone.mutators.items():
207 if attrID in self.mutations:
208 mutator.value = self.mutations[attrID]
209
210 drone.amount = self.amount
211 drone.amountActive = self.amountActive
212 return drone
213
214 def __repr__(self):
215 return makeReprStr(self, [

Callers 3

UndoMethod · 0.80
DoMethod · 0.80
DoMethod · 0.80

Calls 5

DroneClass · 0.90
getItemMethod · 0.80
getDynamicItemMethod · 0.80
itemsMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected