From 4607f920c91061068fc5da7e88a2cab639570fa1 Mon Sep 17 00:00:00 2001 From: ldam <ldam@passcal.nmt.edu> Date: Thu, 17 Aug 2023 16:21:32 -0600 Subject: [PATCH] flake8, fix bug calling display_tracking_info with 'info' for LogType.INFO --- sohstationviewer/view/main_window.py | 5 +++-- .../multi_threaded_plotting_widget.py | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sohstationviewer/view/main_window.py b/sohstationviewer/view/main_window.py index 4e26efea4..bfa52c4e4 100755 --- a/sohstationviewer/view/main_window.py +++ b/sohstationviewer/view/main_window.py @@ -546,7 +546,8 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): self.is_plotting_waveform or self.is_plotting_tps) if is_working: msg = 'Already working' - display_tracking_info(self.tracking_info_text_browser, msg, 'info') + display_tracking_info(self.tracking_info_text_browser, + msg, LogType.INFO) return self.has_problem = False @@ -983,7 +984,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): """ display_tracking_info(self.tracking_info_text_browser, 'Cleaning up...', - 'info') + LogType.INFO) if self.data_loader.running: self.data_loader.thread.requestInterruption() self.data_loader.thread.quit() diff --git a/sohstationviewer/view/plotting/plotting_widget/multi_threaded_plotting_widget.py b/sohstationviewer/view/plotting/plotting_widget/multi_threaded_plotting_widget.py index 7e4e0d3ab..33ebfb94d 100644 --- a/sohstationviewer/view/plotting/plotting_widget/multi_threaded_plotting_widget.py +++ b/sohstationviewer/view/plotting/plotting_widget/multi_threaded_plotting_widget.py @@ -1,6 +1,6 @@ # Define functions to call processor -from typing import Tuple, Union, Dict, List, Optional, Callable +from typing import Tuple, Union, Dict, List from PySide2 import QtCore @@ -129,8 +129,8 @@ class MultiThreadedPlottingWidget(PlottingWidget): for chan_id in chan_order: if need_db_info: chan_db_info = get_chan_plot_info(chan_id, - self.parent.data_type, - self.c_mode) + self.parent.data_type, + self.c_mode) if (chan_db_info['height'] == 0 or chan_db_info['plotType'] == ''): # not draw @@ -202,7 +202,7 @@ class MultiThreadedPlottingWidget(PlottingWidget): self.reset_widget() self.is_working = True start_msg = f'Plotting {self.name} data...' - display_tracking_info(self.tracking_box, start_msg, 'info') + display_tracking_info(self.tracking_box, start_msg, LogType.INFO) ret = self.init_plot(d_obj, key, start_tm, end_tm, time_ticks_total) if not ret: @@ -331,7 +331,7 @@ class MultiThreadedPlottingWidget(PlottingWidget): all running background threads. """ display_tracking_info(self.tracking_box, - f'{self.name} plot stopped', 'info') + f'{self.name} plot stopped', LogType.INFO) self.is_working = False self.stopped.emit() @@ -356,7 +356,7 @@ class MultiThreadedPlottingWidget(PlottingWidget): if not self.is_working: self.is_working = True start_msg = 'Zooming in...' - display_tracking_info(self.tracking_box, start_msg, 'info') + display_tracking_info(self.tracking_box, start_msg, LogType.INFO) self.create_plotting_channel_processors(self.plotting_data1) self.create_plotting_channel_processors(self.plotting_data2) self.process_channel() -- GitLab