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

Method newFit

service/fit.py:184–201  ·  view source on GitHub ↗
(self, shipID, name=None)

Source from the content-addressed store, hash-verified

182 return fit.modules[pos]
183
184 def newFit(self, shipID, name=None):
185 pyfalog.debug("Creating new fit for ID: {0}", shipID)
186 try:
187 ship = es_Ship(eos.db.getItem(shipID))
188 except ValueError:
189 ship = es_Citadel(eos.db.getItem(shipID))
190 fit = FitType(ship)
191 fit.name = name if name is not None else "New %s" % fit.ship.item.name
192 fit.damagePattern = self.pattern
193 fit.targetProfile = self.targetProfile
194 fit.character = self.character
195 fit.booster = self.booster
196 useCharImplants = self.serviceFittingOptions["useCharacterImplantsByDefault"]
197 fit.implantLocation = ImplantLocation.CHARACTER if useCharImplants else ImplantLocation.FIT
198 eos.db.save(fit)
199 self.recalc(fit)
200 self.fill(fit)
201 return fit.ID
202
203 @staticmethod
204 def deleteFit(fitID):

Callers 2

createNewFitMethod · 0.80
OnNewFittingMethod · 0.80

Calls 4

recalcMethod · 0.95
fillMethod · 0.95
getItemMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected