Skip to content

Commit

Permalink
[processing] Looks for script algorithm files also in subfolders.
Browse files Browse the repository at this point in the history
  • Loading branch information
radosuav authored and nyalldawson committed Jan 30, 2020
1 parent 67db1db commit 4ed3924
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions python/plugins/processing/script/ScriptAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ def loadAlgorithms(self):
if not folder:
continue

items = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))]
for entry in items:
if entry.lower().endswith(".py"):
moduleName = os.path.splitext(os.path.basename(entry))[0]
filePath = os.path.abspath(os.path.join(folder, entry))
alg = ScriptUtils.loadAlgorithm(moduleName, filePath)
if alg is not None:
self.algs.append(alg)
for path, subdirs, files in os.walk(folder):
for entry in files:
if entry.lower().endswith(".py"):
moduleName = os.path.splitext(os.path.basename(entry))[0]
filePath = os.path.abspath(os.path.join(path, entry))
alg = ScriptUtils.loadAlgorithm(moduleName, filePath)
if alg is not None:
self.algs.append(alg)

for a in self.algs:
self.addAlgorithm(a)

0 comments on commit 4ed3924

Please sign in to comment.