From 302e9b84d3c5ca44ef0a01f77c422bcdf3738e7f Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Fri, 3 Sep 2010 10:21:50 +0300 Subject: [PATCH] Revert "Fixed a rare occurance where an attribute from stats can be None, do the sanity check first before throwing the value to shorten func; cleaned up some commented lines" This reverts commit 3265b1db8a8ad0e1be5eee7757310e3a5c3f6324. --- gui/statsPane.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gui/statsPane.py b/gui/statsPane.py index 11b9836de..7f15f257f 100644 --- a/gui/statsPane.py +++ b/gui/statsPane.py @@ -94,9 +94,12 @@ class StatsPane(wx.Panel): for labelName, value, rounding in stats: label = getattr(self, labelName) - value = value() if fit is not None else 0 - value = value if value is not None else 0 - label.SetLabel(shorten(value, rounding)) + label.SetLabel(shorten(value() if fit is not None else 0, rounding)) + +# resMax = (("cpuTotal", lambda: fit.ship.getModifiedItemAttr("cpuOutput")), +# ("pgTotal", lambda: fit.ship.getModifiedItemAttr("powerOutput")), +# ("droneBayTotal", lambda: fit.ship.getModifiedItemAttr("droneCapacity")), +# ("droneBandwidthTotal", lambda: fit.ship.getModifiedItemAttr("droneBandwidth"))) # cap stuff capState = fit.capState if fit is not None else 0