fix(choose_sentence): 다중 디렉토리 파싱시에 문제 발생하던거 해결

This commit is contained in:
kdh8219 2023-12-23 19:33:28 +09:00
parent 97c5a63bb8
commit 9258c87260
Signed by: kdh8219
GPG key ID: 9B901BE907D1862E

View file

@ -11,7 +11,7 @@ load_dotenv()
_sentences=[]
try:
sentence_files=[]
if os.environ.get("SENTENCES_FILE") and os.path.isfile(os.environ["SENTENCES_FILE"]):
sentence_files.append(os.environ["SENTENCE_FILES"])
@ -23,7 +23,7 @@ try:
if os.environ.get("SENTENCES_DIRECTORIES"):
# 원라인 똥 뿌직(터져도 책임 안짐)
sentence_files.extend([glob(f"{_dir}*.txt") for _dir in filter(os.path.isdir, json.loads(os.environ["SENTENCES_DIRECTORIES"]))])
sentence_files.extend([glob(f"{_dir}*.txt") for _dir in filter(os.path.isdir, json.loads(os.environ["SENTENCES_DIRECTORIES"]))][0])
for sentence_file in sentence_files:
with open(sentence_file, "r") as f: