From 1bb7cb981b7faf10fee3441493d27753f3dfb9b2 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Fri, 20 Sep 2024 15:21:13 +0200 Subject: [PATCH] Minor code review about Python --- dynamic_layers/core/dynamic_layers_engine.py | 4 ++-- dynamic_layers/tools.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dynamic_layers/core/dynamic_layers_engine.py b/dynamic_layers/core/dynamic_layers_engine.py index d2ec724..e9fe291 100644 --- a/dynamic_layers/core/dynamic_layers_engine.py +++ b/dynamic_layers/core/dynamic_layers_engine.py @@ -62,8 +62,8 @@ def update_dynamic_layers_datasource(self): And the given search&replace dictionary """ for layer in self.dynamic_layers.values(): - a = LayerDataSourceModifier(layer, self.project, self.layer, self.feature, self.feedback) - a.compute_new_uri(self.variables) + datasource_modifier = LayerDataSourceModifier(layer, self.project, self.layer, self.feature, self.feedback) + datasource_modifier.compute_new_uri(self.variables) if not self.iface: continue diff --git a/dynamic_layers/tools.py b/dynamic_layers/tools.py index 39aedc3..c6c7c4d 100644 --- a/dynamic_layers/tools.py +++ b/dynamic_layers/tools.py @@ -5,8 +5,6 @@ from pathlib import Path from typing import List -from PyQt5.QtCore import QUrl -from PyQt5.QtGui import QDesktopServices from qgis.core import ( Qgis, QgsExpression, @@ -20,7 +18,8 @@ QgsProject, QgsVectorLayer, ) -from qgis.PyQt.QtCore import QCoreApplication +from qgis.PyQt.QtCore import QCoreApplication, QUrl +from qgis.PyQt.QtGui import QDesktopServices from dynamic_layers.definitions import PLUGIN_MESSAGE