|
|
@@ -24,7 +24,7 @@ OUTPUT_DIR_NAME = "output" |
|
|
|
# Configure YAML to accept environment variables in metadata files |
|
|
|
# Based on https://stackoverflow.com/a/27232341 solution |
|
|
|
pattern = re.compile(r"^ENV\[\'(.*)\'\]$") |
|
|
|
yaml.add_implicit_resolver("!pathex", pattern) |
|
|
|
yaml.add_implicit_resolver("!pathex", pattern, Loader=yaml.SafeLoader) |
|
|
|
|
|
|
|
|
|
|
|
def pathex_constructor(loader, node): |
|
|
@@ -33,7 +33,7 @@ def pathex_constructor(loader, node): |
|
|
|
return os.getenv(env_var) |
|
|
|
|
|
|
|
|
|
|
|
yaml.add_constructor("!pathex", pathex_constructor) |
|
|
|
yaml.add_constructor("!pathex", pathex_constructor, yaml.SafeLoader) |
|
|
|
|
|
|
|
|
|
|
|
def list_galleries_in(path): |
|
|
@@ -43,7 +43,7 @@ def list_galleries_in(path): |
|
|
|
metadata_path = os.path.join(gallery_dir.path, "metadata.yml") |
|
|
|
if os.path.exists(metadata_path): |
|
|
|
with open(metadata_path, "r") as metadata_file: |
|
|
|
metadata = yaml.load(metadata_file) |
|
|
|
metadata = yaml.safe_load(metadata_file) |
|
|
|
|
|
|
|
private = False |
|
|
|
url = f"{gallery_dir.name}.html" |