Fix resource loader
This commit is contained in:
parent
2d263287e6
commit
6ce5922576
@ -14,9 +14,9 @@ from functools import partial
|
||||
|
||||
def _load_resource_file(resource_path):
|
||||
# Import the package
|
||||
pkg_files = importlib.resources.files()
|
||||
with pkg_files.open(resource_path) as file:
|
||||
return file.read_text() # Read the file and return its content
|
||||
pkg_files = importlib.resources.files() / resource_path
|
||||
with pkg_files.open() as file:
|
||||
return file.read() # Read the file and return its content
|
||||
|
||||
def _str_list(value):
|
||||
return value.split(',')
|
||||
@ -86,8 +86,7 @@ def _apply_options(options_file, f):
|
||||
|
||||
return f
|
||||
|
||||
def m2m_options(f):
|
||||
return _apply_options("common_args.yaml", f)
|
||||
m2m_options=partial(_apply_options,"common_args.yaml")
|
||||
|
||||
|
||||
@click.group()
|
||||
|
Loading…
Reference in New Issue
Block a user