Remove some unused imports
This commit is contained in:
@@ -20,14 +20,8 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
|
||||
class CapacitorViewFull(StatsView):
|
||||
name = "capacitorViewFull"
|
||||
@@ -140,7 +134,7 @@ class CapacitorViewFull(StatsView):
|
||||
s = ""
|
||||
else:
|
||||
t = ("%ds" if not capStable else "%.1f%%") % capState
|
||||
s = "Stable: " if capStable else "Lasts "
|
||||
s = "Stable: " if capStable else "Lasts "
|
||||
|
||||
getattr(self, lblNameTime % panel).SetLabel(t)
|
||||
getattr(self, lblNameState % panel).SetLabel(s)
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of pyfa.
|
||||
#
|
||||
# pyfa is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# pyfa is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
class ExampleView(StatsView):
|
||||
name = "exampleView"
|
||||
def __init__(self):
|
||||
StatsView.__init__(self)
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.panel = panel
|
||||
self.mainSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
panel.SetSizer(self.mainSizer)
|
||||
|
||||
self.mainSizer.Add(wx.StaticText(panel, wx.ID_ANY, "Hello world!"))
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "MOO"
|
||||
|
||||
def refreshPanel(self, fit):
|
||||
#If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
pass
|
||||
|
||||
builtinStatsViews.registerView(ExampleView)
|
||||
@@ -20,14 +20,8 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
|
||||
class FirepowerViewFull(StatsView):
|
||||
name = "firepowerViewFull"
|
||||
@@ -56,8 +50,8 @@ class FirepowerViewFull(StatsView):
|
||||
|
||||
|
||||
contentSizer.Add( sizerFirepower, 0, wx.EXPAND, 0)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for damageType, image in (("weapon", "turret") , ("drone", "droneBay")):
|
||||
baseBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
@@ -118,5 +112,5 @@ class FirepowerViewFull(StatsView):
|
||||
label.SetLabel(formatAmount(value, prec, lowest, highest))
|
||||
label.SetToolTip(wx.ToolTip("%.1f" % value))
|
||||
|
||||
|
||||
|
||||
builtinStatsViews.registerView(FirepowerViewFull)
|
||||
|
||||
@@ -20,20 +20,16 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
import controller
|
||||
|
||||
class PriceViewFull(StatsView):
|
||||
name = "priceViewFull"
|
||||
def __init__(self, parent):
|
||||
StatsView.__init__(self)
|
||||
self.parent = parent
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Price"
|
||||
|
||||
@@ -42,19 +38,11 @@ class PriceViewFull(StatsView):
|
||||
return width
|
||||
|
||||
def populatePanel(self, contentPanel, headerPanel):
|
||||
|
||||
contentSizer = contentPanel.GetSizer()
|
||||
|
||||
|
||||
parent = contentPanel
|
||||
panel = "full"
|
||||
|
||||
|
||||
gridPrice = wx.GridSizer(1, 3)
|
||||
|
||||
contentSizer.Add( gridPrice, 0, wx.EXPAND | wx.ALL, 0)
|
||||
|
||||
|
||||
for type in ("ship", "fittings", "total"):
|
||||
image = "%sPrice_big" % type if type != "ship" else "ship_big"
|
||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||
@@ -71,17 +59,38 @@ class PriceViewFull(StatsView):
|
||||
vbox.Add(hbox)
|
||||
|
||||
lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.00")
|
||||
setattr(self, "labelPrice%s" % type, lbl)
|
||||
setattr(self, "labelPrice%s" % type.capitalize(), lbl)
|
||||
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, " m ISK"), 0, wx.ALIGN_LEFT)
|
||||
|
||||
|
||||
|
||||
|
||||
def refreshPanel(self, fit):
|
||||
#If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
#No data available yet
|
||||
pass
|
||||
|
||||
print "r"
|
||||
if fit is not None:
|
||||
# Compose a list of all the data we need & request it
|
||||
typeIDs = []
|
||||
typeIDs.append(fit.ship.item.ID)
|
||||
|
||||
for mod in fit.modules:
|
||||
if not mod.isEmpty:
|
||||
typeIDs.append(mod.itemID)
|
||||
|
||||
for drone in fit.drones:
|
||||
for _ in xrange(drone.amount):
|
||||
typeIDs.append(drone.itemID)
|
||||
|
||||
cMarket = controller.Market.getInstance()
|
||||
cMarket.getPrices(typeIDs, self.processPrices)
|
||||
else:
|
||||
self.labelPriceShip.SetLabel("0.0")
|
||||
self.labelPriceFittings.SetLabel("0.0")
|
||||
self.labelPriceTotal.SetLabel("0.0")
|
||||
|
||||
def processPrices(self, prices):
|
||||
shipPrice = prices[0].price
|
||||
modPrice = sum(map(lambda p: p.price, prices[1:]))
|
||||
self.labelPriceShip.SetLabel(formatAmount(shipPrice, 3, 3, 9))
|
||||
self.labelPriceFittings.SetLabel(formatAmount(modPrice, 3, 3, 9))
|
||||
self.labelPriceTotal.SetLabel(formatAmount(shipPrice + modPrice, 3, 3, 9))
|
||||
|
||||
builtinStatsViews.registerView(PriceViewFull)
|
||||
|
||||
@@ -20,14 +20,8 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
|
||||
class RechargeViewFull(StatsView):
|
||||
name = "rechargeViewFull"
|
||||
@@ -53,7 +47,7 @@ class RechargeViewFull(StatsView):
|
||||
for i in xrange(4):
|
||||
sizerTankStats.AddGrowableCol(i + 1)
|
||||
|
||||
|
||||
|
||||
contentSizer.Add(sizerTankStats, 0, wx.EXPAND, 0)
|
||||
|
||||
#Add an empty label first for correct alignment.
|
||||
@@ -108,7 +102,7 @@ class RechargeViewFull(StatsView):
|
||||
label = getattr(self, "labelTankSustainedShieldPassive")
|
||||
label.SetLabel("0")
|
||||
|
||||
label.SetToolTip(wx.ToolTip("%.3f" % value))
|
||||
label.SetToolTip(wx.ToolTip("%.3f" % value))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,14 +20,9 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
|
||||
class ResistancesViewFull(StatsView):
|
||||
name = "resistancesViewFull"
|
||||
@@ -60,11 +55,11 @@ class ResistancesViewFull(StatsView):
|
||||
stEff = wx.StaticText(headerPanel, wx.ID_ANY, "( Effective HP: ")
|
||||
headerContentSizer.Add(stEff)
|
||||
headerPanel.GetParent().AddToggleItem(stEff)
|
||||
|
||||
|
||||
self.labelEhp = wx.StaticText(headerPanel, wx.ID_ANY, "0")
|
||||
headerContentSizer.Add(self.labelEhp, 0)
|
||||
headerPanel.GetParent().AddToggleItem(self.labelEhp)
|
||||
|
||||
|
||||
stCls = wx.StaticText(headerPanel, wx.ID_ANY, " )")
|
||||
|
||||
headerPanel.GetParent().AddToggleItem( stCls )
|
||||
@@ -77,12 +72,12 @@ class ResistancesViewFull(StatsView):
|
||||
row = 0
|
||||
sizerResistances = wx.GridBagSizer(4, 6)
|
||||
contentSizer.Add( sizerResistances, 0, wx.EXPAND , 0)
|
||||
|
||||
|
||||
for i in xrange(6):
|
||||
sizerResistances.AddGrowableCol(i + 1)
|
||||
|
||||
|
||||
|
||||
|
||||
# Add an empty label, then the rest.
|
||||
sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ))
|
||||
col+=1
|
||||
|
||||
@@ -20,14 +20,12 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
from eos.types import Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
|
||||
class ResourcesViewFull(StatsView):
|
||||
name = "resourcesViewFull"
|
||||
@@ -78,7 +76,7 @@ class ResourcesViewFull(StatsView):
|
||||
setattr(self, "label%sTotal%s%s" % (panel.capitalize(), type.capitalize(), suffix.capitalize()), lbl)
|
||||
box.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
st = wx.VERTICAL
|
||||
st = wx.VERTICAL
|
||||
base.Add(wx.StaticLine(parent, wx.ID_ANY, style=st), 0, wx.EXPAND | wx.LEFT, 3 if panel == "full" else 0)
|
||||
|
||||
|
||||
|
||||
@@ -20,14 +20,7 @@
|
||||
import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
from util import formatAmount
|
||||
|
||||
class TargetingMiscViewFull(StatsView):
|
||||
name = "targetingmiscViewFull"
|
||||
@@ -51,7 +44,7 @@ class TargetingMiscViewFull(StatsView):
|
||||
gridTargetingMisc = wx.FlexGridSizer(1, 3)
|
||||
contentSizer.Add( gridTargetingMisc, 0, wx.EXPAND | wx.ALL, 0)
|
||||
gridTargetingMisc.AddGrowableCol(0)
|
||||
gridTargetingMisc.AddGrowableCol(2)
|
||||
gridTargetingMisc.AddGrowableCol(2)
|
||||
# Targeting
|
||||
|
||||
gridTargeting = wx.FlexGridSizer(4, 2)
|
||||
@@ -122,6 +115,6 @@ class TargetingMiscViewFull(StatsView):
|
||||
value = value() if fit is not None else 0
|
||||
value = value if value is not None else 0
|
||||
label.SetLabel(formatAmount(value, prec, lowest, highest))
|
||||
label.SetToolTip(wx.ToolTip("%.1f" % value))
|
||||
|
||||
label.SetToolTip(wx.ToolTip("%.1f" % value))
|
||||
|
||||
builtinStatsViews.registerView(TargetingMiscViewFull)
|
||||
|
||||
@@ -21,14 +21,6 @@ import wx
|
||||
from gui.statsView import StatsView
|
||||
from gui import builtinStatsViews
|
||||
|
||||
from gui.pyfatogglepanel import TogglePanel
|
||||
from gui import bitmapLoader
|
||||
from gui import pygauge as PG
|
||||
|
||||
from eos.types import Slot, Hardpoint
|
||||
|
||||
from util import formatAmount
|
||||
|
||||
class FirepowerViewFull(StatsView):
|
||||
name = "firepowerViewFull"
|
||||
def __init__(self, parent):
|
||||
@@ -48,7 +40,7 @@ class FirepowerViewFull(StatsView):
|
||||
|
||||
parent = contentPanel
|
||||
panel = "full"
|
||||
contentSizer.Add( sizerResources, 0, wx.EXPAND | wx.ALL, 0)
|
||||
contentSizer.Add( sizerResources, 0, wx.EXPAND | wx.ALL, 0)
|
||||
|
||||
|
||||
|
||||
@@ -56,5 +48,5 @@ class FirepowerViewFull(StatsView):
|
||||
#If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
|
||||
pass
|
||||
|
||||
|
||||
builtinStatsViews.registerView(FirepowerViewFull)
|
||||
|
||||
Reference in New Issue
Block a user