Skip to content

Commit

Permalink
Merge pull request #830 from opengisch/fixabsolute
Browse files Browse the repository at this point in the history
Fix absolute path conversion
  • Loading branch information
signedav authored Oct 7, 2023
2 parents 00ac6bb + d6bd8b5 commit bf4d829
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions QgisModelBaker/gui/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,15 +684,13 @@ def _relative_path(self, path):
return path

def _absolute_path(self, path):
if (
os.path.isfile(path)
and QgsProject.instance().homePath()
and not os.path.isabs(path)
):
# if it's a saved project and the path is not not absolute
return os.path.join(path, QgsProject.instance().homePath(), path)
else:
return path
if QgsProject.instance().homePath() and not os.path.isabs(path):
# if it's a saved project and the path is not absolute
absolute_path = os.path.join(path, QgsProject.instance().homePath(), path)
if os.path.isfile(absolute_path):
return absolute_path
# otherwise most possibly it's an ilidata link
return path

def _validator_stdout(self, txt):
lines = txt.strip().split("\n")
Expand Down

0 comments on commit bf4d829

Please sign in to comment.