From a9784d33e5454a7b2dfbf89859eaeb440aad3c04 Mon Sep 17 00:00:00 2001 From: Ludger Kueperkoch Date: Thu, 14 Jan 2021 10:13:51 +0100 Subject: [PATCH 1/3] If events have been removed, project-event list is updated automatically. --- PyLoT.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PyLoT.py b/PyLoT.py index 2db7a1ff..4a0a60a7 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -1297,10 +1297,15 @@ class MainWindow(QMainWindow): return False else: info_str = '' + i = 0 for event, path_exists in zip(self.project.eventlist, paths_exist): if not path_exists: info_str += '\n{} exists: {}'.format(event.path, path_exists) + del self.project.eventlist[i] + else: + i += 1 print('Unable to find certain event paths:{}'.format(info_str)) + print("Removed these event paths from project eventlist!") return True def modify_project_path(self, new_rootpath): From 172786dc6dac476853d8c362e316fb7ad448f447 Mon Sep 17 00:00:00 2001 From: Ludger Kueperkoch Date: Thu, 14 Jan 2021 14:04:50 +0100 Subject: [PATCH 2/3] [Bugfix] Remove elements of shrinking list! --- PyLoT.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PyLoT.py b/PyLoT.py index 4a0a60a7..863419cf 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -1297,13 +1297,17 @@ class MainWindow(QMainWindow): return False else: info_str = '' + new_eventlist = [] i = 0 for event, path_exists in zip(self.project.eventlist, paths_exist): if not path_exists: info_str += '\n{} exists: {}'.format(event.path, path_exists) - del self.project.eventlist[i] else: - i += 1 + new_eventlist.append(self.project.eventlist[i]) + i += 1 + if len(new_eventlist) > 0: + # adopt changes in event listings + self.project.eventlist = new_eventlist print('Unable to find certain event paths:{}'.format(info_str)) print("Removed these event paths from project eventlist!") return True From bfec58cc2412a07bccdf8b6dfd0fe825ed2b613a Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 1 Feb 2021 16:03:23 +0100 Subject: [PATCH 3/3] [bugfix] entering if when len(mag) == 1 --- PyLoT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyLoT.py b/PyLoT.py index 863419cf..5d85765a 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -1389,7 +1389,7 @@ class MainWindow(QMainWindow): lat = origin.latitude lon = origin.longitude depth = origin.depth - if len(event.magnitudes) >= 1: + if len(event.magnitudes) > 1: moment_magnitude = event.magnitudes[0] local_magnitude = event.magnitudes[1] localmag = '%4.1f' % local_magnitude.mag