From f89537458779942efadf600ce722b81be2bed15c Mon Sep 17 00:00:00 2001 From: Jakob Schnell Date: Mon, 15 Jan 2024 10:03:07 +0100 Subject: [PATCH 1/3] fix: TypeError if no SVGPaths are set (#212) Users may not have SVG Paths set, which leads to the Error described. --- CHANGELOG.md | 5 +++++ ORStools/gui/ORStoolsDialog.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a082b4..0362d711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,11 @@ RELEASING: 13. Create new release in GitHub with tag version and release title of `vX.X.X` --> +## Unreleased + +### Fixed +- TypeError if no SVGPaths are set ([#212](https://github.com/GIScience/orstools-qgis-plugin/issues/212)) + ## [1.7.0] - 2023-12-22 ### Added diff --git a/ORStools/gui/ORStoolsDialog.py b/ORStools/gui/ORStoolsDialog.py index baeb6619..bb6652d1 100644 --- a/ORStools/gui/ORStoolsDialog.py +++ b/ORStools/gui/ORStoolsDialog.py @@ -247,7 +247,7 @@ def run_gui_control(self): # add ors svg path my_new_path = os.path.join(basepath, "img/svg") - svg_paths = QSettings().value("svg/searchPathsForSVG") + svg_paths = QSettings().value("svg/searchPathsForSVG") or [] if my_new_path not in svg_paths: svg_paths.append(my_new_path) QSettings().setValue("svg/searchPathsForSVG", svg_paths) From 4054f4ef81064b92b3a66cbb3f5a854b311d5731 Mon Sep 17 00:00:00 2001 From: Till Frankenbach <81414045+Merydian@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:04:55 +0100 Subject: [PATCH 2/3] docs: add hint to use batch jobs for point layers in tooltip in save vertices button (#216) --- CHANGELOG.md | 3 +++ ORStools/gui/ORStoolsDialogUI.py | 2 +- ORStools/gui/ORStoolsDialogUI.ui | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0362d711..a3076a1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ RELEASING: ## Unreleased +### Added +- Add hint to use batch jobs for point layers in tooltip in save vertices button ([#211](https://github.com/GIScience/orstools-qgis-plugin/issues/211)) + ### Fixed - TypeError if no SVGPaths are set ([#212](https://github.com/GIScience/orstools-qgis-plugin/issues/212)) diff --git a/ORStools/gui/ORStoolsDialogUI.py b/ORStools/gui/ORStoolsDialogUI.py index cbc9e995..18fcb879 100644 --- a/ORStools/gui/ORStoolsDialogUI.py +++ b/ORStools/gui/ORStoolsDialogUI.py @@ -484,7 +484,7 @@ def retranslateUi(self, ORStoolsDialogBase): self.routing_fromline_map.setToolTip(_translate("ORStoolsDialogBase", "

Add wayoints interactively from the map canvas.

Double-click will terminate waypoint selection.

")) self.routing_fromline_clear.setToolTip(_translate("ORStoolsDialogBase", "

If waypoints are selected in the list, only these will be deleted. Else all waypoints will be deleted.

")) self.routing_fromline_list.setToolTip(_translate("ORStoolsDialogBase", "Select waypoints from the map!")) - self.save_vertices.setToolTip(_translate("ORStoolsDialogBase", "

Save points in list to layer.

")) + self.save_vertices.setToolTip(_translate("ORStoolsDialogBase", "

Save points in list to layer. Use the processing algorithms (batch jobs) to work with points from layers.

")) self.advances_group.setTitle(_translate("ORStoolsDialogBase", "Advanced Configuration")) self.optimization_group.setToolTip(_translate("ORStoolsDialogBase", "

Enabling Traveling Salesman will omit all other advanced configuration and assume the preference to be fastest.

")) self.optimization_group.setTitle(_translate("ORStoolsDialogBase", "Traveling Salesman")) diff --git a/ORStools/gui/ORStoolsDialogUI.ui b/ORStools/gui/ORStoolsDialogUI.ui index e484a125..8c5edf1e 100644 --- a/ORStools/gui/ORStoolsDialogUI.ui +++ b/ORStools/gui/ORStoolsDialogUI.ui @@ -350,7 +350,7 @@ - <html><head/><body><p>Save points in list to layer.</p></body></html> + <html><head/><body><p>Save points in list to layer. Use the processing algorithms (batch jobs) to work with points from layers.</p></body></html> From 2c16bcce325742dda68cf4a82738e5bd1e3eb111 Mon Sep 17 00:00:00 2001 From: Till Frankenbach <81414045+Merydian@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:06:08 +0100 Subject: [PATCH 3/3] fix: replace removesuffix() function with replace() function (#217) `str.removesuffix()` is only added in 3.9 and thus might not work with older QGIS version. --- CHANGELOG.md | 2 ++ ORStools/proc/base_processing_algorithm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3076a1c..dc519d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ RELEASING: 13. Create new release in GitHub with tag version and release title of `vX.X.X` --> + ## Unreleased ### Added @@ -46,6 +47,7 @@ RELEASING: ### Fixed - TypeError if no SVGPaths are set ([#212](https://github.com/GIScience/orstools-qgis-plugin/issues/212)) +- replace removesuffix() function with replace() function in base processing algorithm ([#215](https://github.com/GIScience/orstools-qgis-plugin/pull/215)) ## [1.7.0] - 2023-12-22 diff --git a/ORStools/proc/base_processing_algorithm.py b/ORStools/proc/base_processing_algorithm.py index dc9f3fa4..206bc347 100644 --- a/ORStools/proc/base_processing_algorithm.py +++ b/ORStools/proc/base_processing_algorithm.py @@ -185,7 +185,7 @@ def _get_ors_client_from_provider( Connects client to provider and returns a client instance for requests to the ors API """ name = cls.__name__ - name = name.removeprefix("ORS").removesuffix("Algo") + name = name.replace("ORS", "").replace("Algo", "") agent = f"QGIS_{name}" providers = configmanager.read_config()["providers"]