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)
| 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): |
no test coverage detected