Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix absolute path conversion #830

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading