fix(choose_sentence): 미사용된 코드주석 및 테스트 코드 제거
This commit is contained in:
parent
c6de8dd789
commit
12f40fc30f
|
@ -8,25 +8,20 @@ from dotenv import load_dotenv
|
|||
load_dotenv()
|
||||
|
||||
_sentences=[]
|
||||
# try:
|
||||
sentence_files=[]
|
||||
if os.environ.get("SENTENCES_FILE") and os.path.isfile(os.environ["SENTENCES_FILE"]):
|
||||
try:
|
||||
sentence_files=[]
|
||||
if os.environ.get("SENTENCES_FILE") and os.path.isfile(os.environ["SENTENCES_FILE"]):
|
||||
sentence_files.append(os.environ["SENTENCE_FILES"])
|
||||
|
||||
if os.environ.get("SENTENCES_DIRECTORY") and os.path.isdir(os.environ["SENTENCES_DIRECTORY"]):
|
||||
if os.environ.get("SENTENCES_DIRECTORY") and os.path.isdir(os.environ["SENTENCES_DIRECTORY"]):
|
||||
sentence_files.extend(glob(f'{os.environ["SENTENCES_DIRECTORY"]}*.txt'))
|
||||
# for (dirpath, dirnames, filenames) in os.walk(os.environ["SENTENCES_DIRECTORY"]):
|
||||
# for filename in filenames:
|
||||
# sentence_files.append(filename)
|
||||
|
||||
print(sentence_files)
|
||||
|
||||
for sentence_file in sentence_files:
|
||||
for sentence_file in sentence_files:
|
||||
with open(sentence_file, "r") as f:
|
||||
_sentences.extend(f.readlines())
|
||||
# except:
|
||||
# e = sys.exc_info()[1]
|
||||
# _sentences = [f"에러발생(진짜임): {e}"]
|
||||
except:
|
||||
e = sys.exc_info()[1]
|
||||
_sentences = [f"에러발생(진짜임): {e}"]
|
||||
|
||||
# choose random sentence in google spread sheet
|
||||
def chooseSentence() -> str:
|
||||
|
|
Loading…
Reference in a new issue