Skip to content

Commit

Permalink
Use absolute paths for tags dir and wildcard temp files
Browse files Browse the repository at this point in the history
Allows data-dir to function if used together with --gradio-allowed-path
Fixes #188
  • Loading branch information
DominikDoom committed Jun 15, 2023
1 parent 5cbb9ce commit 0c8ed0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/tag_autocomplete_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("-----")

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 0c8ed0d

Please sign in to comment.