From b8490456d7b51a78fefd1796573c5c25d4d0b03b Mon Sep 17 00:00:00 2001 From: Henrik Koski <98282892+PiispaH@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:51:04 +0300 Subject: [PATCH] Conforming to pylint (#2901) * Ran pylint and fixed some things. * Continue to conform to the desires of pylint * Remove old pylintrc * Convert lambdas to def due to pylint --- bin/append_license.py | 2 +- bin/build_ui.py | 12 +- pylintrc | 1180 ++++++++++------- spinetoolbox/execution_managers.py | 10 +- spinetoolbox/fetch_parent.py | 2 - spinetoolbox/headless.py | 21 +- spinetoolbox/helpers.py | 63 +- spinetoolbox/kernel_fetcher.py | 2 +- spinetoolbox/main.py | 2 +- spinetoolbox/mvcmodels/array_model.py | 9 +- .../mvcmodels/compound_table_model.py | 3 +- spinetoolbox/mvcmodels/empty_row_model.py | 2 +- spinetoolbox/mvcmodels/file_list_models.py | 9 +- .../mvcmodels/filter_checkbox_list_model.py | 1 + .../mvcmodels/filter_execution_model.py | 2 +- spinetoolbox/mvcmodels/map_model.py | 14 +- spinetoolbox/mvcmodels/minimal_table_model.py | 4 +- spinetoolbox/mvcmodels/minimal_tree_model.py | 2 - .../project_item_specification_models.py | 4 +- spinetoolbox/mvcmodels/time_pattern_model.py | 4 +- .../time_series_model_variable_resolution.py | 6 +- spinetoolbox/plotting.py | 24 +- spinetoolbox/plugin_manager.py | 6 +- spinetoolbox/project.py | 60 +- spinetoolbox/project_item/project_item.py | 12 +- spinetoolbox/project_item_icon.py | 16 +- spinetoolbox/project_upgrader.py | 38 +- spinetoolbox/server/engine_client.py | 31 +- .../spine_db_editor/graphics_items.py | 12 +- .../spine_db_editor/mvcmodels/empty_models.py | 6 +- .../mvcmodels/entity_tree_item.py | 12 +- .../mvcmodels/frozen_table_model.py | 2 + .../mvcmodels/multi_db_tree_item.py | 6 +- .../mvcmodels/parameter_value_list_item.py | 7 +- .../mvcmodels/pivot_table_models.py | 40 +- .../single_and_empty_model_mixins.py | 1 - .../mvcmodels/single_models.py | 2 +- .../mvcmodels/tree_item_utility.py | 2 +- .../widgets/add_items_dialogs.py | 14 +- .../spine_db_editor/widgets/commit_viewer.py | 2 +- .../spine_db_editor/widgets/custom_editors.py | 1 - .../spine_db_editor/widgets/custom_menus.py | 29 +- .../widgets/custom_qgraphicsviews.py | 3 +- .../widgets/custom_qtableview.py | 10 +- .../widgets/custom_qtreeview.py | 6 +- .../widgets/custom_qwidgets.py | 5 +- .../widgets/edit_or_remove_items_dialogs.py | 26 +- .../widgets/multi_spine_db_editor.py | 2 +- .../widgets/scenario_generator.py | 5 +- .../widgets/spine_db_editor.py | 8 +- .../widgets/stacked_view_mixin.py | 4 +- .../widgets/tabular_view_header_widget.py | 1 + .../widgets/tabular_view_mixin.py | 13 +- spinetoolbox/spine_db_icon_manager.py | 2 +- spinetoolbox/spine_db_manager.py | 31 +- spinetoolbox/spine_db_worker.py | 7 +- spinetoolbox/spine_engine_manager.py | 15 +- spinetoolbox/spine_engine_worker.py | 2 +- spinetoolbox/ui_main.py | 57 +- spinetoolbox/widgets/about_widget.py | 12 - spinetoolbox/widgets/array_value_editor.py | 2 +- spinetoolbox/widgets/commit_dialog.py | 2 +- spinetoolbox/widgets/custom_menus.py | 2 +- spinetoolbox/widgets/custom_qgraphicsscene.py | 2 +- spinetoolbox/widgets/custom_qtableview.py | 41 +- spinetoolbox/widgets/custom_qwidgets.py | 12 +- .../widgets/jupyter_console_widget.py | 8 +- spinetoolbox/widgets/kernel_editor.py | 8 +- spinetoolbox/widgets/multi_tab_spec_editor.py | 9 +- spinetoolbox/widgets/multi_tab_window.py | 7 +- .../widgets/persistent_console_widget.py | 5 +- spinetoolbox/widgets/plot_widget.py | 4 +- spinetoolbox/widgets/project_item_drag.py | 3 + spinetoolbox/widgets/settings_widget.py | 24 +- tests/mock_helpers.py | 13 +- tests/mvcmodels/test_MinimalTableModel.py | 2 +- .../test_TimeSeriesModelFixedResolution.py | 2 +- .../test_TimeSeriesModelVariableResolution.py | 1 + tests/project_item/test_logging_connection.py | 1 - tests/server/test_RemoteSpineEngineManager.py | 12 +- tests/spine_db_editor/helpers.py | 2 +- .../mvcmodels/test_PivotModel.py | 12 +- .../mvcmodels/test_PivotTableModel.py | 171 +-- .../mvcmodels/test_alternative_model.py | 2 +- .../widgets/spine_db_editor_test_base.py | 2 +- .../widgets/test_add_items_dialog.py | 2 +- .../widgets/test_custom_editors.py | 2 +- .../widgets/test_custom_qtableview.py | 16 +- .../widgets/test_custom_qtreeview.py | 8 +- tests/test_ProjectUpgrader.py | 46 +- tests/test_SpineDBManager.py | 2 +- tests/test_SpineToolboxProject.py | 8 +- tests/test_ToolboxUI.py | 9 +- tests/test_helpers.py | 14 +- tests/test_plotting.py | 9 +- tests/test_spine_db_fetcher.py | 2 +- tests/widgets/test_ArrayTableView.py | 6 +- tests/widgets/test_CopyPasteTableView.py | 6 +- tests/widgets/test_IndexedValueTableView.py | 6 +- tests/widgets/test_JupyterConsoleWidget.py | 12 +- tests/widgets/test_MapTableView.py | 5 +- tests/widgets/test_ParameterValueEditor.py | 3 +- tests/widgets/test_custom_combobox.py | 12 +- tests/widgets/test_custom_qgraphicsscene.py | 2 +- tests/widgets/test_custom_qlineedits.py | 6 +- tests/widgets/test_kernel_editor.py | 14 +- tests/widgets/test_open_project_dialog.py | 12 +- tests/widgets/test_plugin_manager_widgets.py | 12 +- 108 files changed, 1285 insertions(+), 1164 deletions(-) diff --git a/bin/append_license.py b/bin/append_license.py index 9d68e7b94..96da7479c 100755 --- a/bin/append_license.py +++ b/bin/append_license.py @@ -45,7 +45,7 @@ def _append_license_py(path): def _append_license_xml(path): """Appends a license header to given .py, .ui or .xml file.""" - xml_license = list() + xml_license = [] xml_license.append("