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

Method getFit

service/fit.py:323–363  ·  view source on GitHub ↗

Gets fit from database Projected is a recursion flag that is set to reduce recursions into projected fits Basic is a flag to simply return the fit without any other processing

(self, fitID, projected=False, basic=False)

Source from the content-addressed store, hash-verified

321 self.fill(fit)
322
323 def getFit(self, fitID, projected=False, basic=False):
324 """
325 Gets fit from database
326
327 Projected is a recursion flag that is set to reduce recursions into projected fits
328 Basic is a flag to simply return the fit without any other processing
329 """
330 # pyfalog.debug("Getting fit for fit ID: {0}", fitID)
331 if fitID is None:
332 return None
333 fit = eos.db.getFit(fitID)
334
335 if fit is None:
336 return None
337
338 self._loadedFits.add(fit)
339
340 if basic:
341 return fit
342
343 inited = getattr(fit, "inited", None)
344
345 if inited is None or inited is False:
346 if not projected:
347 for fitP in fit.projectedFits:
348 self.getFit(fitP.ID, projected=True)
349 self.recalc(fit)
350 self.fill(fit)
351
352 # this will loop through modules and set their restriction flag (set in m.fit())
353 if fit.ignoreRestrictions:
354 for mod in fit.modules:
355 if not mod.isEmpty:
356 mod.fits(fit)
357
358 # Check that the states of all modules are valid
359 self.checkStates(fit, None)
360
361 eos.db.commit()
362 fit.inited = True
363 return fit
364
365 @staticmethod
366 def searchFits(name):

Callers 15

recalcMethod · 0.95
fillMethod · 0.95
getModuleMethod · 0.80
deleteFitMethod · 0.80
copyFitMethod · 0.80
clearFitMethod · 0.80
editNotesMethod · 0.80
switchFitMethod · 0.80
changeCharMethod · 0.80
getTargetProfileMethod · 0.80
setTargetProfileMethod · 0.80
getDamagePatternMethod · 0.80

Calls 4

recalcMethod · 0.95
fillMethod · 0.95
checkStatesMethod · 0.95
fitsMethod · 0.45

Tested by

no test coverage detected