so many pep8 fixes
(cherry picked from commit bee125d)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# =============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of pyfa.
|
||||
@@ -15,7 +15,7 @@
|
||||
#
|
||||
# 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
|
||||
import gui.display as d
|
||||
@@ -26,20 +26,21 @@ from gui.contextMenu import ContextMenu
|
||||
import globalEvents as GE
|
||||
from eos.types import ImplantLocation
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
|
||||
class ImplantView(wx.Panel):
|
||||
def __init__(self, parent):
|
||||
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, style=wx.TAB_TRAVERSAL )
|
||||
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, style=wx.TAB_TRAVERSAL)
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.implantDisplay = ImplantDisplay(self)
|
||||
mainSizer.Add(self.implantDisplay, 1, wx.EXPAND, 0 )
|
||||
mainSizer.Add(self.implantDisplay, 1, wx.EXPAND, 0)
|
||||
|
||||
radioSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
radioSizer.AddSpacer(( 0, 0), 1, wx.EXPAND, 5)
|
||||
radioSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
|
||||
self.rbFit = wx.RadioButton(self, id=wx.ID_ANY, label="Use Fit-specific Implants", style=wx.RB_GROUP)
|
||||
self.rbChar = wx.RadioButton(self, id=wx.ID_ANY, label="Use Character Implants")
|
||||
radioSizer.Add(self.rbFit, 0, wx.ALL, 5)
|
||||
@@ -48,7 +49,7 @@ class ImplantView(wx.Panel):
|
||||
|
||||
mainSizer.Add(radioSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
self.SetSizer( mainSizer )
|
||||
self.SetSizer(mainSizer)
|
||||
self.SetAutoLayout(True)
|
||||
|
||||
self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioSelect, self.rbFit)
|
||||
@@ -93,12 +94,12 @@ class ImplantDisplay(d.Display):
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.click)
|
||||
self.Bind(wx.EVT_KEY_UP, self.kbEvent)
|
||||
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
if "__WXGTK__" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
|
||||
else:
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
|
||||
|
||||
def kbEvent(self,event):
|
||||
def kbEvent(self, event):
|
||||
keycode = event.GetKeyCode()
|
||||
if keycode == wx.WXK_DELETE or keycode == wx.WXK_NUMPAD_DELETE:
|
||||
row = self.GetFirstSelected()
|
||||
@@ -112,7 +113,7 @@ class ImplantDisplay(d.Display):
|
||||
|
||||
self.Parent.Parent.Parent.DisablePage(self.Parent, not fit or fit.isStructure)
|
||||
|
||||
#Clear list and get out if current fitId is None
|
||||
# Clear list and get out if current fitId is None
|
||||
if event.fitID is None and self.lastFitId is not None:
|
||||
self.DeleteAllItems()
|
||||
self.lastFitId = None
|
||||
@@ -121,7 +122,8 @@ class ImplantDisplay(d.Display):
|
||||
|
||||
self.original = fit.implants if fit is not None else None
|
||||
self.implants = stuff = fit.appliedImplants if fit is not None else None
|
||||
if stuff is not None: stuff.sort(key=lambda implant: implant.slot)
|
||||
if stuff is not None:
|
||||
stuff.sort(key=lambda implant: implant.slot)
|
||||
|
||||
if event.fitID != self.lastFitId:
|
||||
self.lastFitId = event.fitID
|
||||
|
||||
Reference in New Issue
Block a user