Fix resource loader

This commit is contained in:
Guilhem Lavaux 2024-04-05 11:58:40 +02:00
parent 85de5cb5f7
commit d02ffe49ff

View File

@ -14,9 +14,9 @@ from functools import partial
def _load_resource_file(resource_path): def _load_resource_file(resource_path):
# Import the package # Import the package
pkg_files = importlib.resources.files() pkg_files = importlib.resources.files() / resource_path
with pkg_files.open(resource_path) as file: with pkg_files.open() as file:
return file.read_text() # Read the file and return its content return file.read() # Read the file and return its content
def _str_list(value): def _str_list(value):
return value.split(',') return value.split(',')
@ -86,8 +86,7 @@ def _apply_options(options_file, f):
return f return f
def m2m_options(f): m2m_options=partial(_apply_options,"common_args.yaml")
return _apply_options("common_args.yaml", f)
@click.group() @click.group()