bajillion pep8 fixes to pass tox

This commit is contained in:
Ebag333
2016-12-13 23:31:39 -08:00
parent be53dedb18
commit 28404cd8bb
206 changed files with 3128 additions and 2391 deletions

View File

@@ -1,6 +1,7 @@
import wx
from gui.bitmapLoader import BitmapLoader
class BaseValidator(wx.PyValidator):
def __init__(self):
wx.PyValidator.__init__(self)
@@ -14,6 +15,7 @@ class BaseValidator(wx.PyValidator):
def TransferFromWindow(self):
return True
class TextEntryValidatedDialog(wx.TextEntryDialog):
def __init__(self, parent, validator=None, *args, **kargs):
wx.TextEntryDialog.__init__(self, parent, *args, **kargs)
@@ -23,7 +25,8 @@ class TextEntryValidatedDialog(wx.TextEntryDialog):
if validator:
self.txtctrl.SetValidator(validator())
class EntityEditor (wx.Panel):
class EntityEditor(wx.Panel):
"""
Entity Editor is a panel that takes some sort of list as a source and populates a drop down with options to add/
rename/clone/delete an entity. Comes with dialogs that take user input. Classes that derive this class must override
@@ -51,7 +54,7 @@ class EntityEditor (wx.Panel):
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON) if name != "rename" else art
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
if size is None:
size = btn.GetSize()
size = btn.GetSize()
btn.SetMinSize(size)
btn.SetMaxSize(size)
@@ -134,8 +137,9 @@ class EntityEditor (wx.Panel):
def OnDelete(self, event):
dlg = wx.MessageDialog(self,
"Do you really want to delete the {} {}?".format(self.getActiveEntity().name, self.entityName),
"Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)
"Do you really want to delete the {} {}?".format(self.getActiveEntity().name,
self.entityName),
"Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)
dlg.CenterOnParent()
if dlg.ShowModal() == wx.ID_YES:
@@ -170,4 +174,4 @@ class EntityEditor (wx.Panel):
return False
self.Parent.Show()
return True
return True

View File

@@ -93,18 +93,18 @@ FitSpawner.register()
# Drag'n'drop handler
class FittingViewDrop(wx.PyDropTarget):
def __init__(self, dropFn):
wx.PyDropTarget.__init__(self)
self.dropFn = dropFn
# this is really transferring an EVE itemID
self.dropData = wx.PyTextDataObject()
self.SetDataObject(self.dropData)
def __init__(self, dropFn):
wx.PyDropTarget.__init__(self)
self.dropFn = dropFn
# this is really transferring an EVE itemID
self.dropData = wx.PyTextDataObject()
self.SetDataObject(self.dropData)
def OnData(self, x, y, t):
if self.GetData():
data = self.dropData.GetText().split(':')
self.dropFn(x, y, data)
return t
def OnData(self, x, y, t):
if self.GetData():
data = self.dropData.GetText().split(':')
self.dropFn(x, y, data)
return t
class FittingView(d.Display):
@@ -372,7 +372,8 @@ class FittingView(d.Display):
module = self.mods[dstRow]
sFit = Fit.getInstance()
sFit.moveCargoToModule(self.mainFrame.getActiveFit(), module.position, srcIdx, mstate.CmdDown() and module.isEmpty)
sFit.moveCargoToModule(self.mainFrame.getActiveFit(), module.position, srcIdx,
mstate.CmdDown() and module.isEmpty)
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit()))
@@ -425,7 +426,7 @@ class FittingView(d.Display):
# as Racks and tactical Modes. This allows us to skip over common
# module operations such as swapping, removing, copying, etc. that
# would otherwise cause complications
self.blanks = [] # preliminary markers where blanks will be inserted
self.blanks = [] # preliminary markers where blanks will be inserted
if sFit.serviceFittingOptions["rackSlots"]:
# flag to know when to add blanks, based on previous slot

View File

@@ -71,10 +71,14 @@ class FleetView(wx.gizmos.TreeListCtrl):
event.Skip()
def checkNew(self, event):
self.GetPyData(event.Item)
# TODO: Doesn't seem to be used
'''
data = self.GetPyData(event.Item)
if data and isinstance(data, tuple) and data[0] == "add":
layer = data[1]
'''
def UpdateTab(self, name, img):
self.tabManager.SetPageTextIcon(self.tabManager.GetSelection(), name, img)

View File

@@ -8,7 +8,7 @@ from gui.bitmapLoader import BitmapLoader
from gui.marketBrowser import SearchBox
class BaseImplantEditorView (wx.Panel):
class BaseImplantEditorView(wx.Panel):
def addMarketViewImage(self, iconFile):
if iconFile is None:
return -1
@@ -19,7 +19,8 @@ class BaseImplantEditorView (wx.Panel):
return self.availableImplantsImageList.Add(bitmap)
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TAB_TRAVERSAL)
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.TAB_TRAVERSAL)
self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
pmainSizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -53,10 +54,12 @@ class BaseImplantEditorView (wx.Panel):
buttonSizer = wx.BoxSizer(wx.VERTICAL)
buttonSizer.AddSpacer((0, 0), 1)
self.btnAdd = GenBitmapButton(self, wx.ID_ADD, BitmapLoader.getBitmap("fit_add_small", "gui"), style=wx.BORDER_NONE)
self.btnAdd = GenBitmapButton(self, wx.ID_ADD, BitmapLoader.getBitmap("fit_add_small", "gui"),
style=wx.BORDER_NONE)
buttonSizer.Add(self.btnAdd, 0)
self.btnRemove = GenBitmapButton(self, wx.ID_REMOVE, BitmapLoader.getBitmap("fit_delete_small", "gui"), style=wx.BORDER_NONE)
self.btnRemove = GenBitmapButton(self, wx.ID_REMOVE, BitmapLoader.getBitmap("fit_delete_small", "gui"),
style=wx.BORDER_NONE)
buttonSizer.Add(self.btnRemove, 0)
buttonSizer.AddSpacer((0, 0), 1)