From 45e95a8fb91a3cc3b555284c1f6d744f1cbf4a2d Mon Sep 17 00:00:00 2001 From: OneNewDev Date: Sat, 28 May 2022 19:34:21 +0200 Subject: [PATCH] add SOURCE_FILENAME constant --- tagger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tagger.py b/tagger.py index 015bbcb..5848d5d 100644 --- a/tagger.py +++ b/tagger.py @@ -8,6 +8,7 @@ from pathlib import Path from exclude import EXCLUDED_WORDS SOURCE_DIR = Path('data') +SOURCE_FILENAME = 'index.txt' OUTPUT_FILE = 'tags.json' TAGS_PER_ARTICLE = 5 JSON_INDENT = 2 @@ -126,7 +127,8 @@ def read_file(file: Path) -> str: def main(): final_tags = {} - for file in SOURCE_DIR.glob('**/index.txt'): # Nach allen index.txt Dateien suchen + # Nach allen Quelldateien suchen + for file in SOURCE_DIR.glob(f'**/{SOURCE_FILENAME}'): # Die Dateien, deren Ordner mit 'autosave-' beginnen, ignorieren. title = file.parent.name if title.startswith('autosave-'):