From 1c0d84662b1f0f10b91483f8f06bc98bc34c7e12 Mon Sep 17 00:00:00 2001 From: Maeva Pourpoint <maeva@passcal.nmt.edu> Date: Mon, 11 Mar 2024 15:35:08 -0600 Subject: [PATCH] Add correct indentation + Rename variables in main module --- nexus/nexus.py | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/nexus/nexus.py b/nexus/nexus.py index 1448a5b8..49692fae 100755 --- a/nexus/nexus.py +++ b/nexus/nexus.py @@ -912,7 +912,6 @@ class NexusWindow(*load_ui("NexusWindow.ui")): dialog.selected_channels, ) self.inv_model.add_inventory(self.inventory) - #self.reshape_tree() def scan_ms_dialog(self): dir_name = QtWidgets.QFileDialog.getExistingDirectory(self, 'Dir to scan for MSEED') @@ -1196,7 +1195,6 @@ class StationWidget(WidgetBase, *load_ui("StationWidget.ui")): self.uiDLType.activated.connect(self.combo_changed) self.build_sensor_combo() self.uiSensorType.activated.connect(self.combo_changed) - self.uiDLType.currentIndexChanged.connect(self.update_model) self.uiSensorType.currentIndexChanged.connect(self.update_model) self.uiDLGain.editingFinished.connect(self.update_model) @@ -1289,17 +1287,15 @@ class StationWidget(WidgetBase, *load_ui("StationWidget.ui")): def copy_dltype_and_gain(self): stations = self.get_stations() - self.copy_to_stations( - stations, - 'type & gain', - [self.uiDLGain.text(), self.uiDLType.currentText()]) + self.copy_to_stations(stations, + 'type & gain', + [self.uiDLGain.text(), self.uiDLType.currentText()]) def copy_sensor(self): stations = self.get_stations() - self.copy_to_stations( - stations, - 'sensor', - [self.uiSensorType.currentText()]) + self.copy_to_stations(stations, + 'sensor', + [self.uiSensorType.currentText()]) def copy_to_stations(self, stations, action, values): dialog = StationSelectDialog(stations, action, values, parent=self) @@ -1310,20 +1306,20 @@ class StationWidget(WidgetBase, *load_ui("StationWidget.ui")): else: copy_this = {"Stype": True} self.update_stations(dialog.selected_stations, copy_this) - self.stat_node_to_obj_map = {} def update_stations(self, stations, copy_this): - for stat in stations: + for station in stations: for node, obj in self.stat_node_to_obj_map.items(): - if stat == obj: + if station == obj: for key, value in copy_this.items(): - if value: - if key == "DLtype": - node.set_dl_type(self.uiDLType.currentIndex()) - elif key == "DLgain": - node.set_dl_gain(self.uiDLGain.text()) - else: - node.set_sensor_type(self.uiSensorType.currentIndex()) + if value is False: + continue + if key == "DLtype": + node.set_dl_type(self.uiDLType.currentIndex()) + elif key == "DLgain": + node.set_dl_gain(self.uiDLGain.text()) + else: + node.set_sensor_type(self.uiSensorType.currentIndex()) def get_stations(self): """ -- GitLab