From 6e614565757448caa8fab12903fb3e85d32510ae Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 8 Jan 2025 22:25:47 +0100 Subject: [PATCH] Added total new line count. --- merge.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/merge.py b/merge.py index 89778d6..ed94006 100644 --- a/merge.py +++ b/merge.py @@ -2,6 +2,15 @@ import pathlib all_content = [] +return_count = 0 +hour_count = 0 + +for file in pathlib.Path("logs_plain").glob("*.txt"): + with open(file, "r") as f: + return_count += f.read().count("[ENTER]") + hour_count += 1 + +lines_per_hour = return_count // hour_count for file in pathlib.Path("logs_summaries").glob("*.txt"): with open(file, "r") as f: @@ -16,6 +25,7 @@ html_content = ['', body { width:100%; background-color: #000; + color: #fff; } img { width:40%; @@ -24,7 +34,14 @@ html_content = ['', } """, -''] +'', +'', +f'Total lines written: {return_count}', +'
', +f'Total lines per hour: {lines_per_hour}', +'
', +'
', +] graph_images = list(pathlib.Path(".").glob("*.png"))