add SOURCE_FILENAME constant

This commit is contained in:
OneNewDev 2022-05-28 19:34:21 +02:00
parent 215ff98d00
commit 45e95a8fb9

View file

@ -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-'):