diff --git a/sohstationviewer.py b/sohstationviewer.py index 9fa480d0c5b85a9476178f43087a9d0e2fc4f0ef..20ecf79e04229f98c5880ddb30c23e8d81a59096 100755 --- a/sohstationviewer.py +++ b/sohstationviewer.py @@ -11,7 +11,7 @@ def main(): app = QtWidgets.QApplication(sys.argv) wnd = MainWindow() wnd.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) if __name__ == '__main__': diff --git a/sohstationviewer/model/data_loader.py b/sohstationviewer/model/data_loader.py index 8322d1bf46df3f14d4ffe81e15f9bb81935991bf..ca79bdcd8553077f1db1247270cc86a60ce98ebf 100644 --- a/sohstationviewer/model/data_loader.py +++ b/sohstationviewer/model/data_loader.py @@ -237,7 +237,7 @@ class DataLoader(QtCore.QObject): ) abort_button = msg_box.addButton(QtWidgets.QMessageBox.Abort) - msg_box.exec_() + msg_box.exec() if msg_box.clickedButton() == abort_button: # The default choice is the first item, so we default to it if the diff --git a/sohstationviewer/view/channel_prefer_dialog.py b/sohstationviewer/view/channel_prefer_dialog.py index 3825fa4ca0118b04be94e13700890fe4f8de5435..137683bd22527eed37730c7dff2753777aa396f1 100755 --- a/sohstationviewer/view/channel_prefer_dialog.py +++ b/sohstationviewer/view/channel_prefer_dialog.py @@ -361,7 +361,7 @@ class ChannelPreferDialog(OneWindowAtATimeDialog): def edit_soh_list(self, row_idx): soh_list_item = self.soh_list_table_widget.item(row_idx, COL['IDs']) edit_dialog = InputDialog(text=soh_list_item.text()) - if edit_dialog.exec_(): + if edit_dialog.exec(): soh_list_item.setText(edit_dialog.get_input()) @QtCore.Slot() diff --git a/sohstationviewer/view/date_edit_with_doy.py b/sohstationviewer/view/date_edit_with_doy.py index 017ef67cea9caeaf4c895b02dbb399345abe050e..a93fa143ade745f2250bc0a71a2f9567695b27e1 100644 --- a/sohstationviewer/view/date_edit_with_doy.py +++ b/sohstationviewer/view/date_edit_with_doy.py @@ -86,7 +86,7 @@ class DayOfYearSupportedDateTextBox(QDateEdit): menu.addAction(copy_action) menu.addAction(select_all_action) - menu.exec_(event.globalPos()) + menu.exec(event.globalPos()) def setDisplayFormat(self, format): """ diff --git a/sohstationviewer/view/db_config/db_config_dialog.py b/sohstationviewer/view/db_config/db_config_dialog.py index 027981fb67f0ee32344dcee2d996b80ae9a08b61..7c6b1fd3cc8035a9ad64b35da90e3d6f9a460009 100755 --- a/sohstationviewer/view/db_config/db_config_dialog.py +++ b/sohstationviewer/view/db_config/db_config_dialog.py @@ -268,7 +268,7 @@ class UiDBInfoDialog(OneWindowAtATimeDialog): msgbox.setText(msg) msgbox.addButton(QtWidgets.QMessageBox.Cancel) msgbox.addButton('Continue', QtWidgets.QMessageBox.YesRole) - result = msgbox.exec_() + result = msgbox.exec() if result == QtWidgets.QMessageBox.Cancel: return self.close() diff --git a/sohstationviewer/view/file_information/file_info_widget.py b/sohstationviewer/view/file_information/file_info_widget.py index b78380f08d4646afd2afadc751ff139efe66bf12..e6d155e0ec9f046b4e65eae551105edb1b07e33f 100644 --- a/sohstationviewer/view/file_information/file_info_widget.py +++ b/sohstationviewer/view/file_information/file_info_widget.py @@ -27,7 +27,7 @@ class FileInfoWidget(QListWidget): menu.addAction(copy_action) menu.addAction(select_all_action) - menu.exec_(event.globalPos()) + menu.exec(event.globalPos()) def keyPressEvent(self, event: QKeyEvent) -> None: if event.matches(QKeySequence.Copy): diff --git a/sohstationviewer/view/help_view.py b/sohstationviewer/view/help_view.py index 5d8fdb77820da53e0ef71adb7462a62a8353d296..a8618b0504b339e68c4151295843376ec4b61bd5 100644 --- a/sohstationviewer/view/help_view.py +++ b/sohstationviewer/view/help_view.py @@ -538,7 +538,7 @@ def main(): wnd = HelpBrowser(home_path='../../') wnd.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) if __name__ == '__main__': diff --git a/sohstationviewer/view/main_window.py b/sohstationviewer/view/main_window.py index 2ed83cbdb5ff01a60adc4d264ef3a8ac2b11a4eb..7748b576ae5a61856fb8bc3118e2166be8f604de 100755 --- a/sohstationviewer/view/main_window.py +++ b/sohstationviewer/view/main_window.py @@ -393,7 +393,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): fd = QtWidgets.QFileDialog(self) fd.setFileMode(QtWidgets.QFileDialog.Directory) fd.setDirectory(self.curr_dir_line_edit.text()) - fd.exec_() + fd.exec() try: new_path = fd.selectedFiles()[0] self.set_current_directory(new_path) @@ -609,7 +609,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): msgbox.setText(str(e)) msgbox.addButton(QtWidgets.QMessageBox.Cancel) msgbox.addButton('Continue', QtWidgets.QMessageBox.YesRole) - result = msgbox.exec_() + result = msgbox.exec() if result == QtWidgets.QMessageBox.Cancel: self.cancel_loading() return @@ -634,7 +634,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): QMessageBox.Abort) data_too_big_dialog.setDefaultButton(QMessageBox.Abort) data_too_big_dialog.setIcon(QMessageBox.Question) - ret = data_too_big_dialog.exec_() + ret = data_too_big_dialog.exec() if ret == QMessageBox.Abort: self.cancel_loading() return diff --git a/sohstationviewer/view/plotting/gps_plot/gps_dialog.py b/sohstationviewer/view/plotting/gps_plot/gps_dialog.py index 7526acfff9bc8e11aa805df306fa39ddc61999a8..96e5d1fd50172af028c73e2000d3801c9ae234c0 100644 --- a/sohstationviewer/view/plotting/gps_plot/gps_dialog.py +++ b/sohstationviewer/view/plotting/gps_plot/gps_dialog.py @@ -326,7 +326,7 @@ class GPSDialog(QtWidgets.QWidget): fd = QtWidgets.QFileDialog(self) fd.setFileMode(QtWidgets.QFileDialog.Directory) fd.setDirectory(self.export_dir_textbox.text()) - fd.exec_() + fd.exec() new_path = fd.selectedFiles()[0] self.set_export_directory(new_path) @@ -432,4 +432,4 @@ if __name__ == '__main__': wnd.data_path = Path(data_path) wnd.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py index a307ee3dcc4ef38b97bd39253f171775de189ecc..e82f518ce2d11d0d1134f154bcd2c0b98349dfcd 100755 --- a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py @@ -650,7 +650,7 @@ class PlottingWidget(QtWidgets.QScrollArea): msgbox.setText(msg) msgbox.addButton(QtWidgets.QMessageBox.Cancel) msgbox.addButton('Continue', QtWidgets.QMessageBox.YesRole) - result = msgbox.exec_() + result = msgbox.exec() if result == QtWidgets.QMessageBox.Cancel: return self.main_window.color_mode = self.c_mode @@ -667,12 +667,12 @@ class PlottingWidget(QtWidgets.QScrollArea): msgbox.setText(msg) msgbox.addButton(QtWidgets.QMessageBox.Cancel) msgbox.addButton('Continue', QtWidgets.QMessageBox.YesRole) - result = msgbox.exec_() + result = msgbox.exec() if result == QtWidgets.QMessageBox.Cancel: return save_plot_dlg = SavePlotDialog( self.parent, self.main_window, default_name) - save_plot_dlg.exec_() + save_plot_dlg.exec() save_file_path = save_plot_dlg.save_file_path if save_file_path is None: return diff --git a/sohstationviewer/view/save_plot_dialog.py b/sohstationviewer/view/save_plot_dialog.py index 0de627299a5dab0944f215ab4d3a0c579c6255ff..d5e7a5fc1732d2d00de0bdf445fe41ef2bffaeca 100644 --- a/sohstationviewer/view/save_plot_dialog.py +++ b/sohstationviewer/view/save_plot_dialog.py @@ -93,7 +93,7 @@ class SavePlotDialog(QDialog): fd = QtWidgets.QFileDialog(self) fd.setFileMode(QtWidgets.QFileDialog.Directory) fd.setDirectory(self.save_dir_textbox.text()) - fd.exec_() + fd.exec() new_path = fd.selectedFiles()[0] self.save_dir_textbox.setText(new_path) self.save_dir_path = new_path @@ -133,7 +133,7 @@ if __name__ == '__main__': save_path = '/Users/ldam/Documents/GIT/sohstationviewer/tests/test_data/Q330-sample' # noqa: E501 test = SavePlotDialog(None, 'test_plot') test.set_save_directory(save_path) - test.exec_() + test.exec() print("dpi:", test.dpi) print("save file path:", test.save_file_path) - sys.exit(app.exec_()) + sys.exit(app.exec()) diff --git a/sohstationviewer/view/search_message/search_message_dialog.py b/sohstationviewer/view/search_message/search_message_dialog.py index c535f494bac2826b8a9a2bbeee5be7e0b72e40f8..8aeb3f2b75607af0cdeb3d84d3d6064e8daead31 100644 --- a/sohstationviewer/view/search_message/search_message_dialog.py +++ b/sohstationviewer/view/search_message/search_message_dialog.py @@ -705,7 +705,7 @@ def main(): wnd.show() # wnd.show_log_entry_from_data_index(10) - sys.exit(app.exec_()) + sys.exit(app.exec()) if __name__ == '__main__': diff --git a/sohstationviewer/view/select_buttons_dialog.py b/sohstationviewer/view/select_buttons_dialog.py index 4cbf11c6f089a9f0ebb7288c8e162d96068f3db7..f4efebe38b0c8d9dd8916f313c2fa02503f1bc1c 100644 --- a/sohstationviewer/view/select_buttons_dialog.py +++ b/sohstationviewer/view/select_buttons_dialog.py @@ -62,7 +62,7 @@ if __name__ == '__main__': test = SelectButtonDialog(None, "Testing result from buttons", ['test01', 'test02', 'test03', 'test11', 'test12', 'test13']) - test.exec_() + test.exec() print("return Code:", test.ret) - sys.exit(app.exec_()) + sys.exit(app.exec())