forked from AG_QGIS/Plugin_SN_Basis
Diensteabruf integriert
This commit is contained in:
@@ -4,9 +4,10 @@ Prüft ausschließlich, ob ein Stilpfad gültig ist.
|
||||
Die Anwendung erfolgt später über eine Aktion.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
from sn_basis.functions.sys_wrapper import file_exists
|
||||
from sn_basis.functions.os_wrapper import is_absolute_path
|
||||
from sn_basis.functions.sys_wrapper import get_plugin_root, file_exists, join_path
|
||||
from sn_basis.modules.pruef_ergebnis import pruef_ergebnis
|
||||
|
||||
|
||||
@@ -40,7 +41,11 @@ class Stilpruefer:
|
||||
kontext=None,
|
||||
)
|
||||
|
||||
pfad = Path(stil_pfad)
|
||||
pfad = str(stil_pfad)
|
||||
|
||||
if not is_absolute_path(pfad):
|
||||
plugin_root = get_plugin_root()
|
||||
pfad = str(join_path(plugin_root, "sn_plan41", "assets", pfad))
|
||||
|
||||
# -----------------------------------------------------
|
||||
# 2. Datei existiert nicht
|
||||
@@ -56,7 +61,7 @@ class Stilpruefer:
|
||||
# -----------------------------------------------------
|
||||
# 3. Falsche Endung
|
||||
# -----------------------------------------------------
|
||||
if pfad.suffix.lower() != ".qml":
|
||||
if os.path.splitext(pfad)[1].lower() != ".qml":
|
||||
return pruef_ergebnis(
|
||||
ok=False,
|
||||
meldung="Die Stil-Datei muss die Endung '.qml' haben.",
|
||||
|
||||
Reference in New Issue
Block a user