Skip to content

Commit

Permalink
Fix extension path walk for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sal-uva committed Sep 17, 2024
1 parent d6064be commit bbe79e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/lib/module_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,19 @@ def load_modules(self):
"""
# look for workers and processors in pre-defined folders and datasources

extension_path = Path(config.get('PATH_ROOT'), "extensions")

paths = [Path(config.get('PATH_ROOT'), "processors"),
Path(config.get('PATH_ROOT'), "backend", "workers"),
Path(config.get('PATH_ROOT'), "extensions"),
extension_path,
*[self.datasources[datasource]["path"] for datasource in self.datasources]] # extension datasources will be here and the above line...

root_match = re.compile(r"^%s" % re.escape(str(config.get('PATH_ROOT'))))
root_path = Path(config.get('PATH_ROOT'))

for folder in paths:
# loop through folders, and files in those folders, recursively
is_extension = folder.is_relative_to(Path(config.get("PATH_ROOT"), "extensions"))
is_extension = extension_path in folder.parents or folder == extension_path
for file in folder.rglob("*.py"):
# determine module name for file
# reduce path to be relative to 4CAT root
Expand Down

0 comments on commit bbe79e4

Please sign in to comment.