Skip to content

Option to follow links #32

@Marwe

Description

@Marwe

An improvement for our workflows would be to allow following links.
We use (soft) links within the filesystem to use the data in different contexts, but the plugin stops at links and does not follow them.
Files in linked directories are not available, since the link itself does not match the pattern.

A global fix is relatively easy, I implemented it with the additional option followlinks=True in os.walk, but maybe for an implementation an option with a GUI checkbox would be better (settings object in LoadThemAllDialog.py)? The latter needs changes in different places.

git diff
diff --git a/LoadFiles.py b/LoadFiles.py
index 4089109..69b3718 100644
--- a/LoadFiles.py
+++ b/LoadFiles.py
@@ -66,7 +66,7 @@ class LoadFiles():
         self.progressBar.setMaximum(0)  # ProgressBar in busy mode
         layerPaths = []
 
-        for root, dirs, files in os.walk(self.baseDir):
+        for root, dirs, files in os.walk(self.baseDir,followlinks=True):
             # files = [self.decodeName(f) for f in files]
             for file_ in files:
                 QApplication.processEvents()  # TODO: Perhaps better by chunks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions