Skip to content

Commit 5835c66

Browse files
committed
reorganize strcture
1 parent dac6868 commit 5835c66

31 files changed

+33
-28
lines changed

arho_feature_template/core/exceptions.py

-2
This file was deleted.

arho_feature_template/exceptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ def __init__(self, layer_name: str):
66
class LayerNotVectorTypeError(Exception):
77
def __init__(self, layer_name: str):
88
super().__init__(f"Layer {layer_name} is not a vector layer")
9+
10+
11+
class UnexpectedNoneError(Exception):
12+
"""Internal QGIS errors that should not be happened"""
File renamed without changes.

arho_feature_template/gui/load_plan_dialog.py arho_feature_template/plan/load_plan_dialog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from qgis.PyQt.QtGui import QStandardItem, QStandardItemModel
77
from qgis.PyQt.QtWidgets import QComboBox, QDialog, QDialogButtonBox, QLineEdit, QMessageBox, QPushButton, QTableView
88

9-
from arho_feature_template.core.exceptions import UnexpectedNoneError
9+
from arho_feature_template.exceptions import UnexpectedNoneError
1010

1111
ui_path = resources.files(__package__) / "load_plan_dialog.ui"
1212

arho_feature_template/core/plan_manager.py arho_feature_template/plan/plan_manager.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
from qgis.PyQt.QtWidgets import QDialog, QMessageBox
1010
from qgis.utils import iface
1111

12-
from arho_feature_template.core.lambda_service import LambdaService
13-
from arho_feature_template.gui.load_plan_dialog import LoadPlanDialog
14-
from arho_feature_template.gui.serialize_plan import SerializePlan
12+
from arho_feature_template.plan.load_plan_dialog import LoadPlanDialog
13+
from arho_feature_template.plan.serialize_plan import SerializePlan
1514
from arho_feature_template.utils.db_utils import get_existing_database_connection_names
15+
from arho_feature_template.utils.lambda_service import LambdaService
1616
from arho_feature_template.utils.misc_utils import get_active_plan_id, get_layer_by_name, handle_unsaved_changes
1717

1818
logger = logging.getLogger(__name__)

arho_feature_template/core/feature_template_library.py arho_feature_template/plan_feature/feature_template_library.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
from qgis.PyQt.QtGui import QStandardItem, QStandardItemModel
1010
from qgis.utils import iface
1111

12-
from arho_feature_template.core.template_library_config import (
12+
from arho_feature_template.exceptions import LayerNotFoundError, LayerNotVectorTypeError
13+
from arho_feature_template.plan_feature.plan_feature_form import PlanFeatureForm
14+
from arho_feature_template.plan_feature.template_dock import TemplateLibraryDock
15+
from arho_feature_template.plan_feature.template_library_config import (
1316
FeatureTemplate,
1417
TemplateLibraryConfig,
1518
TemplateLibraryVersionError,
1619
TemplateSyntaxError,
1720
parse_template_library_config,
1821
)
19-
from arho_feature_template.exceptions import LayerNotFoundError, LayerNotVectorTypeError
20-
from arho_feature_template.gui.plan_feature_form import PlanFeatureForm
21-
from arho_feature_template.gui.template_dock import TemplateLibraryDock
2222
from arho_feature_template.resources.template_libraries import library_config_files
2323
from arho_feature_template.utils.project_utils import get_layer_from_project
2424

arho_feature_template/gui/plan_feature_form.py arho_feature_template/plan_feature/plan_feature_form.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
QTreeWidgetItem,
2020
)
2121

22-
from arho_feature_template.core.plan_regulation_group_config import (
22+
from arho_feature_template.plan_regulation_group.plan_regulation_group_config import (
2323
PlanRegulationGroupDefinition,
2424
PlanRegulationGroupLibrary,
2525
)
26-
from arho_feature_template.gui.plan_regulation_group_widget import PlanRegulationGroupWidget
26+
from arho_feature_template.plan_regulation_group.plan_regulation_group_widget import PlanRegulationGroupWidget
2727
from arho_feature_template.qgis_plugin_tools.tools.resources import resources_path
2828

2929
if TYPE_CHECKING:
3030
from qgis.PyQt.QtWidgets import QWidget
3131

32-
from arho_feature_template.core.template_library_config import FeatureTemplate
32+
from arho_feature_template.plan_feature.template_library_config import FeatureTemplate
3333

34-
ui_path = resources.files(__package__) / "template_attribute_form.ui"
34+
ui_path = resources.files(__package__) / "plan_feature_form.ui"
3535
FormClass, _ = uic.loadUiType(ui_path)
3636

3737

arho_feature_template/plan_regulation/__init__.py

Whitespace-only changes.

arho_feature_template/gui/plan_regulation_widget.py arho_feature_template/plan_regulation/plan_regulation_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
QWidget,
2020
)
2121

22-
from arho_feature_template.core.plan_regulation_config import PlanRegulationConfig, ValueType
22+
from arho_feature_template.plan_regulation.plan_regulation_config import PlanRegulationConfig, ValueType
2323
from arho_feature_template.utils.misc_utils import get_additional_information_name, get_layer_by_name
2424

2525
if TYPE_CHECKING:
2626
from qgis.PyQt.QtWidgets import QPushButton
2727

28-
from arho_feature_template.core.plan_regulation_group_config import PlanRegulationDefinition
28+
from arho_feature_template.plan_regulation_group.plan_regulation_group_config import PlanRegulationDefinition
2929

3030
ui_path = resources.files(__package__) / "plan_regulation_widget.ui"
3131
FormClass, _ = uic.loadUiType(ui_path)

arho_feature_template/plan_regulation_group/__init__.py

Whitespace-only changes.

arho_feature_template/core/plan_regulation_group_config.py arho_feature_template/plan_regulation_group/plan_regulation_group_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import yaml
88
from qgis.utils import iface
99

10-
from arho_feature_template.core.plan_regulation_config import PlanRegulationDefinition, PlanRegulationsSet
10+
from arho_feature_template.plan_regulation.plan_regulation_config import PlanRegulationDefinition, PlanRegulationsSet
1111

1212
if TYPE_CHECKING:
1313
from pathlib import Path

arho_feature_template/gui/plan_regulation_group_form.py arho_feature_template/plan_regulation_group/plan_regulation_group_form.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
from qgis.PyQt.QtCore import Qt
88
from qgis.PyQt.QtWidgets import QDialog, QTextBrowser, QTreeWidget, QTreeWidgetItem
99

10-
from arho_feature_template.core.plan_regulation_config import PlanRegulationConfig, PlanRegulationsSet
11-
from arho_feature_template.gui.plan_regulation_widget import PlanRegulationWidget
10+
from arho_feature_template.plan_regulation.plan_regulation_config import PlanRegulationConfig, PlanRegulationsSet
11+
from arho_feature_template.plan_regulation.plan_regulation_widget import PlanRegulationWidget
1212

1313
if TYPE_CHECKING:
1414
from qgis.PyQt.QtWidgets import QBoxLayout, QWidget
1515

16-
ui_path = resources.files(__package__) / "new_plan_regulation_group_form.ui"
16+
ui_path = resources.files(__package__) / "plan_regulation_group_form.ui"
1717
FormClass, _ = uic.loadUiType(ui_path)
1818

1919

arho_feature_template/gui/plan_regulation_group_widget.py arho_feature_template/plan_regulation_group/plan_regulation_group_widget.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
from qgis.PyQt.QtCore import pyqtSignal
99
from qgis.PyQt.QtWidgets import QWidget
1010

11-
from arho_feature_template.gui.plan_regulation_widget import PlanRegulationWidget
11+
from arho_feature_template.plan_regulation.plan_regulation_widget import PlanRegulationWidget
1212

1313
if TYPE_CHECKING:
1414
from qgis.PyQt.QtWidgets import QFrame, QLineEdit, QPushButton
1515

16-
from arho_feature_template.core.plan_regulation_config import PlanRegulationDefinition
17-
from arho_feature_template.core.plan_regulation_group_config import PlanRegulationGroupDefinition
16+
from arho_feature_template.plan_regulation.plan_regulation_config import PlanRegulationDefinition
17+
from arho_feature_template.plan_regulation_group.plan_regulation_group_config import PlanRegulationGroupDefinition
1818

1919
ui_path = resources.files(__package__) / "plan_regulation_group_widget.ui"
2020
FormClass, _ = uic.loadUiType(ui_path)

arho_feature_template/plugin.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
from qgis.PyQt.QtWidgets import QAction, QWidget
88
from qgis.utils import iface
99

10-
from arho_feature_template.core.feature_template_library import FeatureTemplater, TemplateGeometryDigitizeMapTool
11-
from arho_feature_template.core.plan_manager import PlanManager
12-
from arho_feature_template.gui.plan_regulation_group_form import PlanRegulationGroupForm
13-
from arho_feature_template.gui.plugin_settings import PluginSettings
10+
from arho_feature_template.plan.plan_manager import PlanManager
11+
from arho_feature_template.plan_feature.feature_template_library import (
12+
FeatureTemplater,
13+
TemplateGeometryDigitizeMapTool,
14+
)
15+
from arho_feature_template.plan_regulation_group.plan_regulation_group_form import PlanRegulationGroupForm
1416
from arho_feature_template.qgis_plugin_tools.tools.custom_logging import setup_logger, teardown_logger
1517
from arho_feature_template.qgis_plugin_tools.tools.i18n import setup_translation
1618
from arho_feature_template.qgis_plugin_tools.tools.resources import plugin_name
19+
from arho_feature_template.utils.plugin_settings import PluginSettings
1720

1821
if TYPE_CHECKING:
1922
from qgis.gui import QgisInterface, QgsMapTool

arho_feature_template/plugin_settings/__init__.py

Whitespace-only changes.

arho_feature_template/utils/db_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from qgis.core import QgsProviderRegistry
66

7-
from arho_feature_template.core.exceptions import UnexpectedNoneError
7+
from arho_feature_template.exceptions import UnexpectedNoneError
88

99
LOGGER = logging.getLogger("LandUsePlugin")
1010

0 commit comments

Comments
 (0)