From 844053793d21229fa4baa61772f571c8622613c5 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Wed, 2 Aug 2023 14:26:10 +0200 Subject: remove user input --- bjoern/videoanalyse/LogParser.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'bjoern/videoanalyse') diff --git a/bjoern/videoanalyse/LogParser.py b/bjoern/videoanalyse/LogParser.py index 703ffa2..448b283 100755 --- a/bjoern/videoanalyse/LogParser.py +++ b/bjoern/videoanalyse/LogParser.py @@ -112,25 +112,20 @@ def generate_log(activities: dict): return(log) -choice = input( - "Press 'l' and enter to extract log data. Make sure this script" - + "file is in the folder containing the VP-subfolders." -) -if choice == "l": - for vp_dir in [f.name for f in os.scandir() if f.is_dir()]: - print(vp_dir) - log = extract_activities(get_log_data(vp_dir)) - log = generate_log(log) - - history = get_history_db(vp_dir) - log = match_urls(history, log) - - path = Path(f"{vp_dir}/{vp_dir}.csv") - with open(path, "w") as csvfile: - writer = csv.writer(csvfile, delimiter=",", quoting=csv.QUOTE_NONNUMERIC) - writer.writerow(["Starttime", "Endtime", "Title", "URL"]) - for row in log: - writer.writerow(row) +for vp_dir in [f.name for f in os.scandir() if f.is_dir()]: + print(vp_dir) + log = extract_activities(get_log_data(vp_dir)) + log = generate_log(log) + + history = get_history_db(vp_dir) + log = match_urls(history, log) + + path = Path(f"{vp_dir}/{vp_dir}.csv") + with open(path, "w") as csvfile: + writer = csv.writer(csvfile, delimiter=",", quoting=csv.QUOTE_NONNUMERIC) + writer.writerow(["Starttime", "Endtime", "Title", "URL"]) + for row in log: + writer.writerow(row) input("*Press enter to close*") -- cgit v1.2.3