add SOURCE_FILENAME constant
This commit is contained in:
parent
215ff98d00
commit
45e95a8fb9
|
@ -8,6 +8,7 @@ from pathlib import Path
|
||||||
from exclude import EXCLUDED_WORDS
|
from exclude import EXCLUDED_WORDS
|
||||||
|
|
||||||
SOURCE_DIR = Path('data')
|
SOURCE_DIR = Path('data')
|
||||||
|
SOURCE_FILENAME = 'index.txt'
|
||||||
OUTPUT_FILE = 'tags.json'
|
OUTPUT_FILE = 'tags.json'
|
||||||
TAGS_PER_ARTICLE = 5
|
TAGS_PER_ARTICLE = 5
|
||||||
JSON_INDENT = 2
|
JSON_INDENT = 2
|
||||||
|
@ -126,7 +127,8 @@ def read_file(file: Path) -> str:
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
final_tags = {}
|
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.
|
# Die Dateien, deren Ordner mit 'autosave-' beginnen, ignorieren.
|
||||||
title = file.parent.name
|
title = file.parent.name
|
||||||
if title.startswith('autosave-'):
|
if title.startswith('autosave-'):
|
||||||
|
|
Loading…
Reference in a new issue