From 131644bddca4ab848d3c9c2f1b6ea2790477f68b Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Fri, 27 Sep 2024 13:16:18 +0200 Subject: [PATCH 1/2] refacto(pep8): homogeneize naming conventions --- .../{Bookmarks => bookmarks}/__init__.py | 0 .../bookmark_handler.py | 0 .../__init__.py | 0 .../customization_handler.py | 0 .../{Dataservices => dataservices}/__init__.py | 0 .../datasource_distributor.py | 0 .../datasource_handler.py | 18 +++++++++--------- .../datasource_provider.py | 0 .../{Favourites => favourites}/__init__.py | 0 .../favourites_handler.py | 0 .../{Functions => functions}/__init__.py | 0 .../function_handler.py | 0 .../datasources/{Models => models}/__init__.py | 0 .../{Models => models}/model_handler.py | 0 .../{Models => models}/script_handler.py | 0 .../{Plugins => plugins}/__init__.py | 0 .../{Plugins => plugins}/plugin_displayer.py | 0 .../{Plugins => plugins}/plugin_handler.py | 6 +++--- .../{Plugins => plugins}/plugin_importer.py | 0 .../{Plugins => plugins}/plugin_remover.py | 0 .../datasources/{Styles => styles}/__init__.py | 0 .../{Styles => styles}/style_handler.py | 0 .../{userInterface => gui}/__init__.py | 0 .../interface_handler.py | 2 +- .../name_profile_dialog.py | 0 profile_manager/profile_manager.py | 7 ++++--- profile_manager/profiles/profile_copier.py | 2 +- profile_manager/profiles/profile_creator.py | 2 +- profile_manager/profiles/profile_editor.py | 2 +- 29 files changed, 20 insertions(+), 19 deletions(-) rename profile_manager/datasources/{Bookmarks => bookmarks}/__init__.py (100%) rename profile_manager/datasources/{Bookmarks => bookmarks}/bookmark_handler.py (100%) rename profile_manager/datasources/{Customizations => customizations}/__init__.py (100%) rename profile_manager/datasources/{Customizations => customizations}/customization_handler.py (100%) rename profile_manager/datasources/{Dataservices => dataservices}/__init__.py (100%) rename profile_manager/datasources/{Dataservices => dataservices}/datasource_distributor.py (100%) rename profile_manager/datasources/{Dataservices => dataservices}/datasource_handler.py (91%) rename profile_manager/datasources/{Dataservices => dataservices}/datasource_provider.py (100%) rename profile_manager/datasources/{Favourites => favourites}/__init__.py (100%) rename profile_manager/datasources/{Favourites => favourites}/favourites_handler.py (100%) rename profile_manager/datasources/{Functions => functions}/__init__.py (100%) rename profile_manager/datasources/{Functions => functions}/function_handler.py (100%) rename profile_manager/datasources/{Models => models}/__init__.py (100%) rename profile_manager/datasources/{Models => models}/model_handler.py (100%) rename profile_manager/datasources/{Models => models}/script_handler.py (100%) rename profile_manager/datasources/{Plugins => plugins}/__init__.py (100%) rename profile_manager/datasources/{Plugins => plugins}/plugin_displayer.py (100%) rename profile_manager/datasources/{Plugins => plugins}/plugin_handler.py (92%) rename profile_manager/datasources/{Plugins => plugins}/plugin_importer.py (100%) rename profile_manager/datasources/{Plugins => plugins}/plugin_remover.py (100%) rename profile_manager/datasources/{Styles => styles}/__init__.py (100%) rename profile_manager/datasources/{Styles => styles}/style_handler.py (100%) rename profile_manager/{userInterface => gui}/__init__.py (100%) rename profile_manager/{userInterface => gui}/interface_handler.py (99%) rename profile_manager/{userInterface => gui}/name_profile_dialog.py (100%) diff --git a/profile_manager/datasources/Bookmarks/__init__.py b/profile_manager/datasources/bookmarks/__init__.py similarity index 100% rename from profile_manager/datasources/Bookmarks/__init__.py rename to profile_manager/datasources/bookmarks/__init__.py diff --git a/profile_manager/datasources/Bookmarks/bookmark_handler.py b/profile_manager/datasources/bookmarks/bookmark_handler.py similarity index 100% rename from profile_manager/datasources/Bookmarks/bookmark_handler.py rename to profile_manager/datasources/bookmarks/bookmark_handler.py diff --git a/profile_manager/datasources/Customizations/__init__.py b/profile_manager/datasources/customizations/__init__.py similarity index 100% rename from profile_manager/datasources/Customizations/__init__.py rename to profile_manager/datasources/customizations/__init__.py diff --git a/profile_manager/datasources/Customizations/customization_handler.py b/profile_manager/datasources/customizations/customization_handler.py similarity index 100% rename from profile_manager/datasources/Customizations/customization_handler.py rename to profile_manager/datasources/customizations/customization_handler.py diff --git a/profile_manager/datasources/Dataservices/__init__.py b/profile_manager/datasources/dataservices/__init__.py similarity index 100% rename from profile_manager/datasources/Dataservices/__init__.py rename to profile_manager/datasources/dataservices/__init__.py diff --git a/profile_manager/datasources/Dataservices/datasource_distributor.py b/profile_manager/datasources/dataservices/datasource_distributor.py similarity index 100% rename from profile_manager/datasources/Dataservices/datasource_distributor.py rename to profile_manager/datasources/dataservices/datasource_distributor.py diff --git a/profile_manager/datasources/Dataservices/datasource_handler.py b/profile_manager/datasources/dataservices/datasource_handler.py similarity index 91% rename from profile_manager/datasources/Dataservices/datasource_handler.py rename to profile_manager/datasources/dataservices/datasource_handler.py index 197078e..4b47311 100644 --- a/profile_manager/datasources/Dataservices/datasource_handler.py +++ b/profile_manager/datasources/dataservices/datasource_handler.py @@ -1,21 +1,21 @@ from qgis.PyQt.QtWidgets import QMessageBox -from profile_manager.datasources.Bookmarks.bookmark_handler import import_bookmarks -from profile_manager.datasources.Customizations.customization_handler import ( +from profile_manager.datasources.bookmarks.bookmark_handler import import_bookmarks +from profile_manager.datasources.customizations.customization_handler import ( import_customizations, ) -from profile_manager.datasources.Dataservices.datasource_distributor import ( +from profile_manager.datasources.dataservices.datasource_distributor import ( import_data_sources, remove_data_sources, ) -from profile_manager.datasources.Favourites.favourites_handler import import_favourites -from profile_manager.datasources.Functions.function_handler import ( +from profile_manager.datasources.favourites.favourites_handler import import_favourites +from profile_manager.datasources.functions.function_handler import ( import_expression_functions, ) -from profile_manager.datasources.Models.model_handler import import_models -from profile_manager.datasources.Models.script_handler import import_scripts -from profile_manager.datasources.Plugins.plugin_handler import PluginHandler -from profile_manager.datasources.Styles.style_handler import import_styles +from profile_manager.datasources.models.model_handler import import_models +from profile_manager.datasources.models.script_handler import import_scripts +from profile_manager.datasources.plugins.plugin_handler import PluginHandler +from profile_manager.datasources.styles.style_handler import import_styles from profile_manager.utils import adjust_to_operating_system diff --git a/profile_manager/datasources/Dataservices/datasource_provider.py b/profile_manager/datasources/dataservices/datasource_provider.py similarity index 100% rename from profile_manager/datasources/Dataservices/datasource_provider.py rename to profile_manager/datasources/dataservices/datasource_provider.py diff --git a/profile_manager/datasources/Favourites/__init__.py b/profile_manager/datasources/favourites/__init__.py similarity index 100% rename from profile_manager/datasources/Favourites/__init__.py rename to profile_manager/datasources/favourites/__init__.py diff --git a/profile_manager/datasources/Favourites/favourites_handler.py b/profile_manager/datasources/favourites/favourites_handler.py similarity index 100% rename from profile_manager/datasources/Favourites/favourites_handler.py rename to profile_manager/datasources/favourites/favourites_handler.py diff --git a/profile_manager/datasources/Functions/__init__.py b/profile_manager/datasources/functions/__init__.py similarity index 100% rename from profile_manager/datasources/Functions/__init__.py rename to profile_manager/datasources/functions/__init__.py diff --git a/profile_manager/datasources/Functions/function_handler.py b/profile_manager/datasources/functions/function_handler.py similarity index 100% rename from profile_manager/datasources/Functions/function_handler.py rename to profile_manager/datasources/functions/function_handler.py diff --git a/profile_manager/datasources/Models/__init__.py b/profile_manager/datasources/models/__init__.py similarity index 100% rename from profile_manager/datasources/Models/__init__.py rename to profile_manager/datasources/models/__init__.py diff --git a/profile_manager/datasources/Models/model_handler.py b/profile_manager/datasources/models/model_handler.py similarity index 100% rename from profile_manager/datasources/Models/model_handler.py rename to profile_manager/datasources/models/model_handler.py diff --git a/profile_manager/datasources/Models/script_handler.py b/profile_manager/datasources/models/script_handler.py similarity index 100% rename from profile_manager/datasources/Models/script_handler.py rename to profile_manager/datasources/models/script_handler.py diff --git a/profile_manager/datasources/Plugins/__init__.py b/profile_manager/datasources/plugins/__init__.py similarity index 100% rename from profile_manager/datasources/Plugins/__init__.py rename to profile_manager/datasources/plugins/__init__.py diff --git a/profile_manager/datasources/Plugins/plugin_displayer.py b/profile_manager/datasources/plugins/plugin_displayer.py similarity index 100% rename from profile_manager/datasources/Plugins/plugin_displayer.py rename to profile_manager/datasources/plugins/plugin_displayer.py diff --git a/profile_manager/datasources/Plugins/plugin_handler.py b/profile_manager/datasources/plugins/plugin_handler.py similarity index 92% rename from profile_manager/datasources/Plugins/plugin_handler.py rename to profile_manager/datasources/plugins/plugin_handler.py index aa80d57..41f2cb6 100644 --- a/profile_manager/datasources/Plugins/plugin_handler.py +++ b/profile_manager/datasources/plugins/plugin_handler.py @@ -1,8 +1,8 @@ from qgis.PyQt.QtCore import Qt -from profile_manager.datasources.Plugins.plugin_displayer import PluginDisplayer -from profile_manager.datasources.Plugins.plugin_importer import import_plugins -from profile_manager.datasources.Plugins.plugin_remover import remove_plugins +from profile_manager.datasources.plugins.plugin_displayer import PluginDisplayer +from profile_manager.datasources.plugins.plugin_importer import import_plugins +from profile_manager.datasources.plugins.plugin_remover import remove_plugins class PluginHandler: diff --git a/profile_manager/datasources/Plugins/plugin_importer.py b/profile_manager/datasources/plugins/plugin_importer.py similarity index 100% rename from profile_manager/datasources/Plugins/plugin_importer.py rename to profile_manager/datasources/plugins/plugin_importer.py diff --git a/profile_manager/datasources/Plugins/plugin_remover.py b/profile_manager/datasources/plugins/plugin_remover.py similarity index 100% rename from profile_manager/datasources/Plugins/plugin_remover.py rename to profile_manager/datasources/plugins/plugin_remover.py diff --git a/profile_manager/datasources/Styles/__init__.py b/profile_manager/datasources/styles/__init__.py similarity index 100% rename from profile_manager/datasources/Styles/__init__.py rename to profile_manager/datasources/styles/__init__.py diff --git a/profile_manager/datasources/Styles/style_handler.py b/profile_manager/datasources/styles/style_handler.py similarity index 100% rename from profile_manager/datasources/Styles/style_handler.py rename to profile_manager/datasources/styles/style_handler.py diff --git a/profile_manager/userInterface/__init__.py b/profile_manager/gui/__init__.py similarity index 100% rename from profile_manager/userInterface/__init__.py rename to profile_manager/gui/__init__.py diff --git a/profile_manager/userInterface/interface_handler.py b/profile_manager/gui/interface_handler.py similarity index 99% rename from profile_manager/userInterface/interface_handler.py rename to profile_manager/gui/interface_handler.py index 3623875..906c408 100644 --- a/profile_manager/userInterface/interface_handler.py +++ b/profile_manager/gui/interface_handler.py @@ -5,7 +5,7 @@ from qgis.PyQt.QtGui import QColor, QIcon, QPalette from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem -from profile_manager.datasources.Dataservices.datasource_provider import ( +from profile_manager.datasources.dataservices.datasource_provider import ( DATA_SOURCE_SEARCH_LOCATIONS, get_data_sources_tree, ) diff --git a/profile_manager/userInterface/name_profile_dialog.py b/profile_manager/gui/name_profile_dialog.py similarity index 100% rename from profile_manager/userInterface/name_profile_dialog.py rename to profile_manager/gui/name_profile_dialog.py diff --git a/profile_manager/profile_manager.py b/profile_manager/profile_manager.py index 1bba902..d4f4892 100644 --- a/profile_manager/profile_manager.py +++ b/profile_manager/profile_manager.py @@ -29,6 +29,7 @@ from shutil import copytree from sys import platform +# PyQGIS from qgis.core import Qgis, QgsMessageLog, QgsUserProfileManager from qgis.PyQt.QtCore import ( QCoreApplication, @@ -41,13 +42,13 @@ from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtWidgets import QAction, QMessageBox, QWidget -# Import subclasses -from profile_manager.datasources.Dataservices.datasource_handler import ( +# plugin +from profile_manager.datasources.dataservices.datasource_handler import ( DataSourceHandler, ) +from profile_manager.gui.interface_handler import InterfaceHandler from profile_manager.profile_manager_dialog import ProfileManagerDialog from profile_manager.profiles.profile_action_handler import ProfileActionHandler -from profile_manager.userInterface.interface_handler import InterfaceHandler from profile_manager.utils import adjust_to_operating_system, wait_cursor diff --git a/profile_manager/profiles/profile_copier.py b/profile_manager/profiles/profile_copier.py index d897c35..d1429b7 100644 --- a/profile_manager/profiles/profile_copier.py +++ b/profile_manager/profiles/profile_copier.py @@ -2,7 +2,7 @@ from qgis.PyQt.QtWidgets import QDialog, QMessageBox -from profile_manager.userInterface.name_profile_dialog import NameProfileDialog +from profile_manager.gui.name_profile_dialog import NameProfileDialog from profile_manager.utils import wait_cursor diff --git a/profile_manager/profiles/profile_creator.py b/profile_manager/profiles/profile_creator.py index 9b93bdc..5abc03f 100644 --- a/profile_manager/profiles/profile_creator.py +++ b/profile_manager/profiles/profile_creator.py @@ -3,7 +3,7 @@ from qgis.core import QgsUserProfileManager from qgis.PyQt.QtWidgets import QDialog, QMessageBox -from profile_manager.userInterface.name_profile_dialog import NameProfileDialog +from profile_manager.gui.name_profile_dialog import NameProfileDialog from profile_manager.utils import adjust_to_operating_system, wait_cursor diff --git a/profile_manager/profiles/profile_editor.py b/profile_manager/profiles/profile_editor.py index f0de194..8ffb2d9 100644 --- a/profile_manager/profiles/profile_editor.py +++ b/profile_manager/profiles/profile_editor.py @@ -4,7 +4,7 @@ from qgis.core import QgsApplication from qgis.PyQt.QtWidgets import QDialog, QMessageBox -from profile_manager.userInterface.name_profile_dialog import NameProfileDialog +from profile_manager.gui.name_profile_dialog import NameProfileDialog from profile_manager.utils import adjust_to_operating_system, wait_cursor From d3c58380a56cc2208b4667f764a57836d6283255 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:37:36 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- profile_manager/gui/interface_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile_manager/gui/interface_handler.py b/profile_manager/gui/interface_handler.py index 906c408..e83b594 100644 --- a/profile_manager/gui/interface_handler.py +++ b/profile_manager/gui/interface_handler.py @@ -2,7 +2,7 @@ from qgis.core import Qgis, QgsApplication, QgsMessageLog from qgis.PyQt.QtCore import Qt, QVariant -from qgis.PyQt.QtGui import QColor, QIcon, QPalette +from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem from profile_manager.datasources.dataservices.datasource_provider import (