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 3265b1db8a.
This commit is contained in:
HomeWorld
2010-09-03 10:21:50 +03:00
parent 3265b1db8a
commit 302e9b84d3

View File

@@ -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