aboutsummaryrefslogtreecommitdiff
path: root/src/Watcher/commands.py
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-03-22 15:50:09 +0600
committerLibravatar Mubashshir <ahm@jadupc.com>2023-03-22 16:43:38 +0600
commit46cb28417cff9220836e5e4aad62e54aad0b5351 (patch)
tree4ffb2246bb0d0653c0c0fb765e3f801097ce1367 /src/Watcher/commands.py
parent695623e4f60f7937e53cd3be0c921ff40edaca82 (diff)
downloadshopno-os-log-sync-46cb28417cff9220836e5e4aad62e54aad0b5351.tar.gz
shopno-os-log-sync-46cb28417cff9220836e5e4aad62e54aad0b5351.zip
path: Use `xdg.BaseDirectory` to get cache path
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/Watcher/commands.py')
-rw-r--r--[-rwxr-xr-x]src/Watcher/commands.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Watcher/commands.py b/src/Watcher/commands.py
index 8805dac..7e1b948 100755..100644
--- a/src/Watcher/commands.py
+++ b/src/Watcher/commands.py
@@ -1,9 +1,11 @@
import os
import csv
+import uuid
import datetime
from watch_log import get_date
import analysis as anls
import time_operations as to
+import files
class Color:
@@ -71,8 +73,7 @@ def daily_summary(date = get_date()):
print(" " + Color.GREEN(f'{x:<22}') + '\t ',f'{to.format_time(y):>12}')
def week_summary(week = os.popen('''date +"W%V-%Y"''').read()[:-1]):
- user = os.getlogin()
- filename = "/home/"+user+"/.cache/Watcher/Analysis/"+week+".csv"
+ filename = files.weekly_log(week)
with open(filename, 'r') as file:
csvreader = csv.reader(file, delimiter='\t')
week_overview = dict()