summaryrefslogtreecommitdiff
path: root/bjoern/videoanalyse
diff options
context:
space:
mode:
Diffstat (limited to 'bjoern/videoanalyse')
-rwxr-xr-xbjoern/videoanalyse/LogParser.py33
1 files changed, 14 insertions, 19 deletions
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*")