aboutsummaryrefslogtreecommitdiff
path: root/src/Watcher/analysis.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/Watcher/analysis.py')
-rwxr-xr-xsrc/Watcher/analysis.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Watcher/analysis.py b/src/Watcher/analysis.py
index 0e917f8..d43b1b4 100755
--- a/src/Watcher/analysis.py
+++ b/src/Watcher/analysis.py
@@ -3,11 +3,11 @@ import csv
from watch_log import get_date
import datetime
import time_operations as to
+import files
# creating dictionary to store time spend on each applicaitons on that particular day
def final_report(date):
- path = "/home/" + os.getlogin() +"/.cache/Watcher/daily_data/"
- filename = path + date + ".csv"
+ filename = files.daily_log(date)
report = dict()
if os.path.isfile(filename):
@@ -64,7 +64,7 @@ def weekday_from_date(date):
def weekly_logs(week = str(os.popen('''date +"W%V-%Y"''').read()[0:-1])):
user = os.getlogin()
- filename = "/home/"+user+"/.cache/Watcher/Analysis/"+week+".csv"
+ filename = files.weekly_log(week)
with open(filename, "w") as csvfile:
csvwriter = csv.writer(csvfile, delimiter='\t')
@@ -95,4 +95,3 @@ def weekly_logs(week = str(os.popen('''date +"W%V-%Y"''').read()[0:-1])):
#testing
if __name__ == "__main__":
weekly_logs("W29-2022")
-