diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 901c6fecb..fcc901b3b 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -880,8 +880,9 @@ class MainFrame(wx.Frame, IPortUser): def onPortProcessStart(self): # flag for progress dialog. self.__progress_flag = True - # 2017/03/29 NOTE: implementation like interface + def onPortProcessing(self, action, data=None): + # 2017/03/29 NOTE: implementation like interface wx.CallAfter( self._onPortProcessing, action, data ) @@ -909,8 +910,8 @@ class MainFrame(wx.Frame, IPortUser): dlg = wx.MessageDialog(self, "The following error was generated\n\n%s\n\nBe aware that already processed fits were not saved" % data, _message, wx.OK | wx.ICON_ERROR) -# if dlg.ShowModal() == wx.ID_OK: -# return + # if dlg.ShowModal() == wx.ID_OK: + # return dlg.ShowModal() return diff --git a/service/port.py b/service/port.py index aa3776ff3..b2b7163c1 100644 --- a/service/port.py +++ b/service/port.py @@ -145,13 +145,13 @@ class IPortUser: __metaclass__ = ABCMeta - ID_PULSE = 1 + ID_PULSE = 1 # Pulse the progress bar ID_UPDATE = ID_PULSE << 1 # Replace message with data: update messate - ID_DONE = ID_PULSE << 2 + ID_DONE = ID_PULSE << 2 # open fits: import process done - ID_ERROR = ID_PULSE << 3 + ID_ERROR = ID_PULSE << 3 # display error: raise some error PROCESS_IMPORT = ID_PULSE << 4 @@ -236,7 +236,7 @@ class Port(object): msg = "Processing file:\n%s" % path pyfalog.debug(msg) PortProcessing.notify(iportuser, IPortUser.PROCESS_IMPORT | IPortUser.ID_UPDATE, msg) - #wx.CallAfter(callback, 1, msg) + # wx.CallAfter(callback, 1, msg) file_ = open(path, "r") srcString = file_.read() @@ -327,7 +327,6 @@ class Port(object): return True, fit_list - @staticmethod def importFitFromBuffer(bufferStr, activeFit=None): sFit = svcFit.getInstance() @@ -471,10 +470,10 @@ class Port(object): @staticmethod def importCrest(str_): - sMkt = Market.getInstance() + sMkt = Market.getInstance() fitobj = Fit() refobj = json.loads(str_) - items = refobj['items'] + items = refobj['items'] fitobj.name = refobj['name'] # 2017/03/29: read description # "<" and ">" is replace to "<", ">" by EVE client @@ -989,7 +988,7 @@ class Port(object): description = "" elif len(description): # convert
to "\n" and remove html tags. - description = sequential_rep(description, r"<(br|BR)>", "\n",r"<[^<>]+>", "") + description = sequential_rep(description, r"<(br|BR)>", "\n", r"<[^<>]+>", "") # description = re.sub(r"<(br|BR)>", "\n", description) # description = re.sub(r"<[^<>]+>", "", description) fitobj.notes = description @@ -1275,7 +1274,7 @@ class Port(object): hardware.setAttribute("type", name) fitting.appendChild(hardware) except Exception as e: -# print("Failed on fitID: %d" % fit.ID) + # print("Failed on fitID: %d" % fit.ID) pyfalog.error("Failed on fitID: %d, message: %s" % e.message) continue finally: @@ -1365,4 +1364,3 @@ class PortProcessing(object): def notify(iportuser, flag, data): if not iportuser.onPortProcessing(flag, data): raise UserCancelException -