From 4d8c3eadbc1d6e6758c9aae9a3ede37c328e1e9d Mon Sep 17 00:00:00 2001 From: jeffy-g Date: Mon, 3 Apr 2017 01:50:26 +0900 Subject: [PATCH] pep8 --- eos/saveddata/ship.py | 2 +- gui/mainFrame.py | 14 ++++---------- service/port.py | 7 +++---- utils/strfunctions.py | 2 +- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/eos/saveddata/ship.py b/eos/saveddata/ship.py index 10b047c71..d2b7b7119 100644 --- a/eos/saveddata/ship.py +++ b/eos/saveddata/ship.py @@ -73,7 +73,7 @@ class Ship(ItemAttrShortcut, HandledItem): @property def name(self): - # NOTE: add name property + # NOTE: add name property return self.__item.name @property diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 60e2b7f26..901c6fecb 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -802,10 +802,7 @@ class MainFrame(wx.Frame, IPortUser): "Importing fits", " " * 100, # set some arbitrary spacing to create width in window parent=self, - style=wx.PD_CAN_ABORT - | wx.PD_SMOOTH - | wx.PD_ELAPSED_TIME - | wx.PD_APP_MODAL + style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL ) # self.progressDialog.message = None Port.importFitsThreaded(dlg.GetPaths(), self) @@ -840,10 +837,7 @@ class MainFrame(wx.Frame, IPortUser): "Backing up %d fits to: %s" % (max_, filePath), maximum=max_, parent=self, - style=wx.PD_CAN_ABORT - | wx.PD_SMOOTH - | wx.PD_ELAPSED_TIME - | wx.PD_APP_MODAL + style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL ) Port.backupFits(filePath, self) self.progressDialog.ShowModal() @@ -891,6 +885,7 @@ class MainFrame(wx.Frame, IPortUser): wx.CallAfter( self._onPortProcessing, action, data ) + return self.__progress_flag def _onPortProcessing(self, action, data): @@ -924,7 +919,7 @@ class MainFrame(wx.Frame, IPortUser): if action & IPortUser.ID_PULSE: _message = () # update message - elif action & IPortUser.ID_UPDATE: # and data != self.progressDialog.message: + elif action & IPortUser.ID_UPDATE: # and data != self.progressDialog.message: _message = data if _message is not None: @@ -940,7 +935,6 @@ class MainFrame(wx.Frame, IPortUser): else: self.__progress_flag, _unuse = self.progressDialog.Update(data[0], data[1]) - def _openAfterImport(self, fits): if len(fits) > 0: if len(fits) == 1: diff --git a/service/port.py b/service/port.py index a63dafd7e..aa3776ff3 100644 --- a/service/port.py +++ b/service/port.py @@ -47,6 +47,8 @@ from eos.saveddata.ship import Ship from eos.saveddata.citadel import Citadel from eos.saveddata.fit import Fit from service.market import Market +from utils.strfunctions import sequential_rep, replaceLTGT +from abc import ABCMeta, abstractmethod if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)): from service.crest import Crest @@ -72,7 +74,6 @@ INV_FLAG_DRONEBAY = 87 INV_FLAG_FIGHTER = 158 -from utils.strfunctions import sequential_rep, replaceLTGT # -- 170327 Ignored description -- localized_pattern = re.compile(r'([^\*]+)\*') @@ -110,6 +111,7 @@ def _resolveShip(fitting, sMkt): # True means localized return matches is not None, fitobj + def _resolveModule(hardware, sMkt, b_localized): moduleName = hardware.getAttribute("type") emergency = None @@ -139,9 +141,6 @@ class UserCancelException(Exception): pass -from abc import ABCMeta, abstractmethod - - class IPortUser: __metaclass__ = ABCMeta diff --git a/utils/strfunctions.py b/utils/strfunctions.py index a1decbd1c..cd769d20b 100644 --- a/utils/strfunctions.py +++ b/utils/strfunctions.py @@ -25,10 +25,10 @@ def sequential_rep(text_, *args): return text_ + def replaceLTGT(text_): """if fit name contained "<" or ">" then reprace to named html entity by EVE client. for fit name. """ return text_.replace("<", "<").replace(">", ">") if isinstance(text_, unicode) else text_ -