Make AuDaGe look for the config.yaml file relative to the __init__ module.
This commit is contained in:
@@ -8,12 +8,18 @@ date: 2026-10-30
|
||||
desc: Global variables for the AuDaGe package.
|
||||
"""
|
||||
|
||||
from importlib import resources
|
||||
|
||||
import yaml
|
||||
|
||||
CONFIG_PATH = "../../config.yaml"
|
||||
|
||||
safe: bool = True
|
||||
"""Default to disallowing evaluating Python from YAML files. Can be overridden
|
||||
when calling AuDaGe from the command line with the argument `--unsafe`.
|
||||
"""
|
||||
|
||||
with open("config.yaml") as config_file:
|
||||
folders = yaml.safe_load(config_file.read())["folders"]
|
||||
config_path = resources.files().joinpath(CONFIG_PATH)
|
||||
|
||||
with config_path.open("r") as config_file:
|
||||
folders: list[str] = yaml.safe_load(config_file.read())["folders"]
|
||||
Reference in New Issue
Block a user