From eeb700c75d724bbfc9bc9b2f71effeb0211c379e Mon Sep 17 00:00:00 2001 From: blitzmann Date: Tue, 15 May 2018 01:41:32 -0400 Subject: [PATCH] Get back into tox's good graces --- eos/db/saveddata/character.py | 3 --- .../warpscrambleblockmwdwithnpceffect.py | 4 ++-- eos/saveddata/character.py | 1 - eos/saveddata/ssocharacter.py | 1 - .../pyfaEsiPreferences.py | 22 +++++++------------ .../pyfaNetworkPreferences.py | 6 ++--- gui/builtinStatsViews/firepowerViewFull.py | 2 +- gui/characterEditor.py | 1 - gui/characterSelection.py | 1 - gui/chrome_tabs.py | 7 +++--- gui/esiFittings.py | 14 ++++-------- gui/ssoLogin.py | 1 + gui/updateDialog.py | 2 +- gui/utils/exportHtml.py | 2 +- service/character.py | 1 + service/esi.py | 5 ++--- service/esiAccess.py | 3 +-- service/fit.py | 2 -- service/jargon/jargon.py | 5 +++-- service/jargon/loader.py | 9 +++++--- service/market.py | 3 +-- service/marketSources/evemarketdata.py | 2 +- service/port.py | 2 +- service/update.py | 3 ++- tox.ini | 2 +- 25 files changed, 43 insertions(+), 61 deletions(-) diff --git a/eos/db/saveddata/character.py b/eos/db/saveddata/character.py index 739a34a98..850c41c6e 100644 --- a/eos/db/saveddata/character.py +++ b/eos/db/saveddata/character.py @@ -29,9 +29,6 @@ from eos.saveddata.user import User from eos.saveddata.character import Character, Skill from eos.saveddata.ssocharacter import SsoCharacter - - - characters_table = Table("characters", saveddata_meta, Column("ID", Integer, primary_key=True), Column("name", String, nullable=False), diff --git a/eos/effects/warpscrambleblockmwdwithnpceffect.py b/eos/effects/warpscrambleblockmwdwithnpceffect.py index 89c97117e..27a82548a 100644 --- a/eos/effects/warpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/warpscrambleblockmwdwithnpceffect.py @@ -17,8 +17,8 @@ def handler(fit, module, context): # this is such a dirty hack for mod in fit.modules: if not mod.isEmpty and mod.state > State.ONLINE and ( - mod.item.requiresSkill("Micro Jump Drive Operation") - or mod.item.requiresSkill("High Speed Maneuvering") + mod.item.requiresSkill("Micro Jump Drive Operation") or + mod.item.requiresSkill("High Speed Maneuvering") ): mod.state = State.ONLINE if not mod.isEmpty and mod.item.requiresSkill("Micro Jump Drive Operation") and mod.state > State.ONLINE: diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index 55edd9121..9edb866e8 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -170,7 +170,6 @@ class Character(object): if x.client == clientHash: self.__ssoCharacters.remove(x) - def getSsoCharacter(self, clientHash): return next((x for x in self.__ssoCharacters if x.client == clientHash), None) diff --git a/eos/saveddata/ssocharacter.py b/eos/saveddata/ssocharacter.py index d1234c2c4..04b57bdc9 100644 --- a/eos/saveddata/ssocharacter.py +++ b/eos/saveddata/ssocharacter.py @@ -33,7 +33,6 @@ class SsoCharacter(object): self.refreshToken = refreshToken self.accessTokenExpires = None - @reconstructor def init(self): pass diff --git a/gui/builtinPreferenceViews/pyfaEsiPreferences.py b/gui/builtinPreferenceViews/pyfaEsiPreferences.py index ef81b7480..7eaf31a4e 100644 --- a/gui/builtinPreferenceViews/pyfaEsiPreferences.py +++ b/gui/builtinPreferenceViews/pyfaEsiPreferences.py @@ -43,13 +43,17 @@ class PFEsiPref(PreferenceView): rbSizer = wx.BoxSizer(wx.HORIZONTAL) self.rbMode = wx.RadioBox(panel, -1, "Login Authentication Method", wx.DefaultPosition, wx.DefaultSize, ['Local Server', 'Manual'], 1, wx.RA_SPECIFY_COLS) - self.rbMode.SetItemToolTip(0, "This options starts a local webserver that the web application will call back to with information about the character login.") - self.rbMode.SetItemToolTip(1, "This option prompts users to copy and paste information from the web application to allow for character login. Use this if having issues with the local server.") + self.rbMode.SetItemToolTip(0, "This options starts a local webserver that the web application will call back to" + " with information about the character login.") + self.rbMode.SetItemToolTip(1, "This option prompts users to copy and paste information from the web application " + "to allow for character login. Use this if having issues with the local server.") self.rbSsoMode = wx.RadioBox(panel, -1, "SSO Mode", wx.DefaultPosition, wx.DefaultSize, ['pyfa.io', 'Custom application'], 1, wx.RA_SPECIFY_COLS) - self.rbSsoMode.SetItemToolTip(0, "This options routes SSO Logins through pyfa.io, allowing you to easily login without any configuration. When in doubt, use this option.") - self.rbSsoMode.SetItemToolTip(1, "This option goes through EVE SSO directly, but requires more configuration. Use this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io.") + self.rbSsoMode.SetItemToolTip(0, "This options routes SSO Logins through pyfa.io, allowing you to easily login " + "without any configuration. When in doubt, use this option.") + self.rbSsoMode.SetItemToolTip(1, "This option goes through EVE SSO directly, but requires more configuration. Use " + "this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io.") self.rbMode.SetSelection(self.settings.get('loginMode')) self.rbSsoMode.SetSelection(self.settings.get('ssoMode')) @@ -70,12 +74,6 @@ class PFEsiPref(PreferenceView): mainSizer.Add(wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND, 5) - # self.stInfo = wx.StaticText(panel, wx.ID_ANY, - # u"Using custom applications details will let pyfa to access the SSO under your application, rather than the pyfa application that is automatically set up. This requires you to set up your own ESI client application and accept CCPs License Agreement. Additionally, when setting up your client, make sure the callback url is set to 'http://localhost:6461'. Please see the pyfa wiki for more information regarding this", - # wx.DefaultPosition, wx.DefaultSize, 0) - # self.stInfo.Wrap(dlgWidth) - # mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5) - fgAddrSizer = wx.FlexGridSizer(2, 2, 0, 0) fgAddrSizer.AddGrowableCol(1) fgAddrSizer.SetFlexibleDirection(wx.BOTH) @@ -105,10 +103,6 @@ class PFEsiPref(PreferenceView): mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5) - - - timeoutSizer = wx.BoxSizer(wx.HORIZONTAL) - # self.stTimout = wx.StaticText(panel, wx.ID_ANY, "Timeout (seconds):", wx.DefaultPosition, wx.DefaultSize, 0) # self.stTimout.Wrap(-1) # diff --git a/gui/builtinPreferenceViews/pyfaNetworkPreferences.py b/gui/builtinPreferenceViews/pyfaNetworkPreferences.py index 4f9887f8a..526dc0930 100644 --- a/gui/builtinPreferenceViews/pyfaNetworkPreferences.py +++ b/gui/builtinPreferenceViews/pyfaNetworkPreferences.py @@ -150,10 +150,10 @@ class PFNetworkPref(PreferenceView): proxy = self.settings.autodetect() if proxy is not None: - addr, port = proxy - txt = addr + ":" + str(port) + addr, port = proxy + txt = addr + ":" + str(port) else: - txt = "None" + txt = "None" self.stPSAutoDetected.SetLabel("Auto-detected: " + txt) self.stPSAutoDetected.Disable() diff --git a/gui/builtinStatsViews/firepowerViewFull.py b/gui/builtinStatsViews/firepowerViewFull.py index 98d54d714..29ce7a482 100644 --- a/gui/builtinStatsViews/firepowerViewFull.py +++ b/gui/builtinStatsViews/firepowerViewFull.py @@ -129,7 +129,7 @@ class FirepowerViewFull(StatsView): # Remove effective label hsizer = self.headerPanel.GetSizer() hsizer.Hide(self.stEff) - #self.stEff.Destroy() + # self.stEff.Destroy() # Get the new view view = StatsView.getView("miningyieldViewFull")(self.parent) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index f7520e42c..9adc72d8e 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -830,7 +830,6 @@ class APIView(wx.Panel): if sso is None: self.charChoice.SetSelection(noneID) - # # if chars: # for charName in chars: diff --git a/gui/characterSelection.py b/gui/characterSelection.py index cc63a1f82..051ce69b4 100644 --- a/gui/characterSelection.py +++ b/gui/characterSelection.py @@ -170,7 +170,6 @@ class CharacterSelection(wx.Panel): def charChanged(self, event): fitID = self.mainFrame.getActiveFit() charID = self.getActiveCharacter() - sChar = Character.getInstance() if charID == -1: # revert to previous character diff --git a/gui/chrome_tabs.py b/gui/chrome_tabs.py index c03edacab..10354b9be 100644 --- a/gui/chrome_tabs.py +++ b/gui/chrome_tabs.py @@ -1,4 +1,4 @@ -#=============================================================================== +# =============================================================================== # # ToDo: Bug - when selecting close on a tab, sometimes the tab to the right is # selected, most likely due to determination of mouse position @@ -11,7 +11,7 @@ # tab index?). This will also help with finding close buttons. # ToDo: Fix page preview code (PFNotebookPagePreview) # -#= ============================================================================== +# =============================================================================== import wx import wx.lib.newevent @@ -413,7 +413,7 @@ class _TabRenderer: mdc.SelectObject(ebmp) mdc.SetFont(self.font) textSizeX, textSizeY = mdc.GetTextExtent(self.text) - totalSize = self.left_width + self.right_width + textSizeX + self.close_btn_width / 2 + 16 + self.padding* 2 + totalSize = self.left_width + self.right_width + textSizeX + self.close_btn_width / 2 + 16 + self.padding * 2 mdc.SelectObject(wx.NullBitmap) return totalSize, self.tab_height @@ -1478,4 +1478,3 @@ if __name__ == "__main__": top = Frame("Test Chrome Tabs") top.Show() app.MainLoop() - diff --git a/gui/esiFittings.py b/gui/esiFittings.py index 98944fde1..c044ad546 100644 --- a/gui/esiFittings.py +++ b/gui/esiFittings.py @@ -29,7 +29,6 @@ class EveFittings(wx.Frame): self.mainFrame = parent mainSizer = wx.BoxSizer(wx.VERTICAL) - sEsi = Esi.getInstance() characterSelectSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -119,10 +118,11 @@ class EveFittings(wx.Frame): pyfalog.error(msg) self.statusbar.SetStatusText(msg) except APIException as ex: - del waitDialog # Can't do this in a finally because then it obscures the message dialog + # Can't do this in a finally because then it obscures the message dialog + del waitDialog # noqa: F821 ESIExceptionHandler(self, ex) except Exception as ex: - del waitDialog + del waitDialog # noqa: F821 raise ex def importFitting(self, event): @@ -180,7 +180,6 @@ class ExportToEve(wx.Frame): self.mainFrame = parent self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) - sEsi = Esi.getInstance() mainSizer = wx.BoxSizer(wx.VERTICAL) hSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -232,7 +231,6 @@ class ExportToEve(wx.Frame): return self.charChoice.GetClientData(selection) if selection is not None else None def exportFitting(self, event): - sPort = Port.getInstance() fitID = self.mainFrame.getActiveFit() self.statusbar.SetStatusText("", 0) @@ -242,12 +240,8 @@ class ExportToEve(wx.Frame): return self.statusbar.SetStatusText("Sending request and awaiting response", 1) - sEsi = Esi.getInstance() try: - sFit = Fit.getInstance() - data = sPort.exportESI(sFit.getFit(fitID)) - res = sEsi.postFitting(self.getActiveCharacter(), data) self.statusbar.SetStatusText("", 0) self.statusbar.SetStatusText("", 1) @@ -307,7 +301,7 @@ class SsoCharacterMgmt(wx.Dialog): def ssoLogin(self, event): if (self): - #todo: these events don't unbind properly when window is closed (?), hence the `if`. Figure out better way of doing this. + # todo: these events don't unbind properly when window is closed (?), hence the `if`. Figure out better way of doing this. self.popCharList() event.Skip() diff --git a/gui/ssoLogin.py b/gui/ssoLogin.py index 2ff364752..4a8f1197b 100644 --- a/gui/ssoLogin.py +++ b/gui/ssoLogin.py @@ -1,5 +1,6 @@ import wx + class SsoLogin(wx.Dialog): def __init__(self, parent): wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="SSO Login", size=wx.Size(400, 240)) diff --git a/gui/updateDialog.py b/gui/updateDialog.py index c575eeaf3..0f3c298b6 100644 --- a/gui/updateDialog.py +++ b/gui/updateDialog.py @@ -76,7 +76,7 @@ class UpdateDialog(wx.Dialog): releaseDate.strftime('%B %d, %Y'), "

This is a pre-release, be prepared for unstable features

" if version.is_prerelease else "", markdowner.convert(self.releaseInfo['body']) - ),"") + ), "") notesSizer.Add(self.browser, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) mainSizer.Add(notesSizer, 1, wx.EXPAND, 5) diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 612df367e..0d5456dd0 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -86,7 +86,7 @@ class exportHtmlThread(threading.Thread): Pyfa Fittings - +