From 2633f4b9cf1fab95371800ba75c3575586ef6c73 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Mon, 17 Jul 2017 11:58:32 +0200 Subject: [PATCH] [bugfix] error-prone check for method_id.id --- QtPyLoT.py | 20 ++++++++++---------- pylot/RELEASE-VERSION | 2 +- pylot/core/io/data.py | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 7d9cc3fc..4d37ff70 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -1115,7 +1115,7 @@ class MainWindow(QMainWindow): # MP MP changed to suppress unnecessary user prompt fcheck = ['manual', 'origins', 'magnitude'] try: - self.get_data().exportEvent(fbasename, exform, fcheck='manual', + self.get_data().exportEvent(fbasename, exform, fcheck=fcheck, upperErrors=[uppererrorP[3], uppererrorS[3]]) except FormatError as e: fbasename, exform = getSavePath(e, directory, outformat) @@ -1139,15 +1139,15 @@ class MainWindow(QMainWindow): # export to given path #self.get_data().exportEvent(fbasename, exform, upperErrors=[uppererrorP[3], uppererrorS[3]]) - try: - self.get_data().exportEvent(fbasename, exform[0], fcheck='manual', - upperErrors=[uppererrorP[3], uppererrorS[3]]) - self.get_data().exportEvent(fbasename, exform[1], fcheck='manual', - upperErrors=[uppererrorP[3], uppererrorS[3]]) - except Exception as e: - QMessageBox.warning(self, "PyLoT Warning", - "Could not save event: {}".format(e)) - return + #try: + self.get_data().exportEvent(fbasename, exform[0], fcheck=fcheck, + upperErrors=[uppererrorP[3], uppererrorS[3]]) + self.get_data().exportEvent(fbasename, exform[1], fcheck=fcheck, + upperErrors=[uppererrorP[3], uppererrorS[3]]) + # except Exception as e: + # QMessageBox.warning(self, "PyLoT Warning", + # "Could not save event: {}".format(e)) + # return #self.get_data().exportEvent(fbasename, exform[2], upperErrors=[uppererrorP[3], uppererrorS[3]]) # all files save (ui clean) self.update_status('Picks saved as %s, %s, and %s' % (fbasename + exform[0], fbasename + exform[1], diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 87a7a44f..318ca34c 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -7f0a-dirty +7e0f-dirty diff --git a/pylot/core/io/data.py b/pylot/core/io/data.py index eebb3106..a3bd3da1 100644 --- a/pylot/core/io/data.py +++ b/pylot/core/io/data.py @@ -174,7 +174,7 @@ class Data(object): picks = event.picks #remove existing picks for j, pick in reversed(list(enumerate(picks))): - if pick.method_id.id.split('/')[1] == picktype: + if picktype in str(pick.method_id.id): picks.pop(j) checkflag = 1 if checkflag: @@ -182,7 +182,7 @@ class Data(object): #append new picks for pick in self.get_evt_data().picks: - if pick.method_id.id.split('/')[1] == picktype: + if picktype in str(pick.method_id.id): picks.append(pick) def exportEvent(self, fnout, fnext='.xml', fcheck='auto', upperErrors=None):