Skip to content
Permalink
Browse files

[processing] Looks for script algorithm files also in subfolders.

  • Loading branch information
radosuav authored and nyalldawson committed Jan 28, 2020
1 parent 67db1db commit 4ed3924c8fb7a352bd2e4bbd15655c7e9b5157a0
Showing with 8 additions and 8 deletions.
  1. +8 −8 python/plugins/processing/script/ScriptAlgorithmProvider.py
@@ -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.
You can’t perform that action at this time.