From 0c8ed0d2658d96a3f5af0c4247030a67164034e9 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Thu, 15 Jun 2023 21:14:58 +0200 Subject: [PATCH] Use absolute paths for tags dir and wildcard temp files Allows data-dir to function if used together with --gradio-allowed-path Fixes #188 --- scripts/tag_autocomplete_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index 301b0e3..5e00d11 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -67,7 +67,7 @@ def get_ext_wildcards(): wildcard_files = [] for path in WILDCARD_EXT_PATHS: - wildcard_files.append(path.relative_to(FILE_DIR).as_posix()) + wildcard_files.append(path.as_posix()) wildcard_files.extend(p.relative_to(path).as_posix() for p in path.rglob("*.txt") if p.name != "put wildcards here.txt") wildcard_files.append("-----") @@ -192,7 +192,7 @@ def get_lyco(): def write_tag_base_path(): """Writes the tag base path to a fixed location temporary file""" with open(STATIC_TEMP_PATH.joinpath('tagAutocompletePath.txt'), 'w', encoding="utf-8") as f: - f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix()) + f.write(TAGS_PATH.as_posix()) def write_to_temp_file(name, data):