-
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Quentin Ferrand 2022-04-19 11:32:58 +02:00
parent 93b7114ce2
commit 86a3c07396

View file

@ -27,7 +27,7 @@ def write_files(path: str, data: dict, max_num_entries: int) -> None:
num_entries = 0 num_entries = 0
# count entries in index file # count entries in index file
if pathlib.Path(f'{path}/index.gmi').is_file(): if pathlib.Path(f'{path}/index.gmi').is_file():
num_entries = sum(1 for line in open(f'{path}/index.gmi')) # pylint: disable=consider-using-with num_entries = sum(1 for line in open(f'{path}/index.gmi')) # pylint: disable=consider-using-with
# if there is more articles than defined in max_num_entries, delete and rewrite # if there is more articles than defined in max_num_entries, delete and rewrite
if num_entries > max_num_entries: if num_entries > max_num_entries: