From df510c40f49828534eacdbfe2b51663f29d6d267 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Wed, 5 Apr 2017 00:17:13 -0700 Subject: [PATCH 1/2] Some quick cleanup of logging and shtuff --- eos/saveddata/fit.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index d6f1e8ae7..6252c4508 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -32,7 +32,6 @@ from eos.saveddata.ship import Ship from eos.saveddata.character import Character from eos.saveddata.citadel import Citadel from eos.saveddata.module import Module, State, Slot, Hardpoint -from utils.timer import Timer from logbook import Logger pyfalog = Logger(__name__) @@ -459,7 +458,7 @@ class Fit(object): self.commandBonuses[warfareBuffID] = (runTime, value, module, effect) def __runCommandBoosts(self, runTime="normal"): - pyfalog.debug("Applying gang boosts for {0}", self) + pyfalog.debug("Applying gang boosts for {0}", self.ID) for warfareBuffID in self.commandBonuses.keys(): # Unpack all data required to run effect properly effect_runTime, value, thing, effect = self.commandBonuses[warfareBuffID] @@ -638,13 +637,12 @@ class Fit(object): del self.commandBonuses[warfareBuffID] - def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyStorage=None): - timer = Timer(u'Fit: {}, {}'.format(self.ID, self.name), pyfalog) + def calculateModifiedAttributes(self, targetFit=None, withBoosters=False): pyfalog.debug("Starting fit calculation on: {0}, withBoosters: {1}", self, withBoosters) shadow = False if targetFit and not withBoosters: - pyfalog.debug("Applying projections to target: {0}", targetFit) + pyfalog.debug("Calculating projections from {0} to target {1}", self.name, targetFit.name) projectionInfo = self.getProjectionInfo(targetFit.ID) pyfalog.debug("ProjectionInfo: {0}", projectionInfo) if self == targetFit: @@ -693,6 +691,7 @@ class Fit(object): return for runTime in ("early", "normal", "late"): + pyfalog.debug("Run time: {0}", runTime) # Items that are unrestricted. These items are run on the local fit # first and then projected onto the target fit it one is designated u = [ @@ -751,8 +750,6 @@ class Fit(object): targetFit.register(item, origin=self) item.calculateModifiedAttributes(targetFit, runTime, True) - timer.checkpoint('Done with runtime: %s' % runTime) - # Mark fit as calculated self.__calculated = True @@ -760,7 +757,7 @@ class Fit(object): if not projected and not withBoosters: for fit in self.projectedFits: if fit.getProjectionInfo(self.ID).active: - fit.calculateModifiedAttributes(self, withBoosters=withBoosters, dirtyStorage=dirtyStorage) + fit.calculateModifiedAttributes(self, withBoosters=withBoosters) timer.checkpoint('Done with fit calculation') @@ -768,6 +765,8 @@ class Fit(object): pyfalog.debug("Delete shadow fit object") del self + pyfalog.debug('Done with fit calculation') + def fill(self): """ Fill this fit's module slots with enough dummy slots so that all slots are used. From c1b74f481ada564093344f0179d979a5782e15de Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Wed, 5 Apr 2017 00:44:02 -0700 Subject: [PATCH 2/2] Tox --- eos/saveddata/fit.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 6252c4508..c8a881f82 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -759,8 +759,6 @@ class Fit(object): if fit.getProjectionInfo(self.ID).active: fit.calculateModifiedAttributes(self, withBoosters=withBoosters) - timer.checkpoint('Done with fit calculation') - if shadow: pyfalog.debug("Delete shadow fit object") del self