Skip to content

Commit

Permalink
maybe remove import path prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz authored and critias committed Sep 13, 2022
1 parent a7b6d93 commit a5de7fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sisyphus/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def load_config_file(self, config_name):

toolkit.set_root_block(filename)

# maybe remove import path prefix such as "recipe/"
for load_path in gs.IMPORT_PATHS:
if load_path.endswith('/') and filename.startswith(load_path):
filename = filename[len(load_path):]
break
filename = filename.replace(os.path.sep, '.') # allows to use tab completion for file selection
assert all(part.isidentifier() for part in filename.split('.')), "Config name is invalid: %s" % filename
module_name, function_name = filename.rsplit('.', 1)
Expand Down

0 comments on commit a5de7fe

Please sign in to comment.