diff options
author | 2022-03-13 21:57:42 +0530 | |
---|---|---|
committer | 2022-03-13 21:57:42 +0530 | |
commit | 3e6b8706c39b04faa90496bf54f11bf04587ee15 (patch) | |
tree | 782091ca84b9fadc00f0dfd9dfc8d1cbc2dadacd /src/Watcher/week_analysis.py | |
parent | 69db660cfacb005694e96bd5dc1b930d2907e3b9 (diff) | |
download | shopno-os-log-sync-3e6b8706c39b04faa90496bf54f11bf04587ee15.tar.gz shopno-os-log-sync-3e6b8706c39b04faa90496bf54f11bf04587ee15.zip |
exception handling in watcher executable file
Diffstat (limited to 'src/Watcher/week_analysis.py')
-rwxr-xr-x | src/Watcher/week_analysis.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Watcher/week_analysis.py b/src/Watcher/week_analysis.py index 1f064b2..a82b5f3 100755 --- a/src/Watcher/week_analysis.py +++ b/src/Watcher/week_analysis.py @@ -10,7 +10,7 @@ def get_dates(): # The start of the week start = theday - datetime.timedelta(days=weekday) # build a simple range - dates = [start + datetime.timedelta(days=d) for d in range(weekday+1)] + dates = [start + datetime.timedelta(days=d) for d in range(weekday + 1)] dates = [str(d) for d in dates] return dates @@ -19,7 +19,7 @@ def weekday_from_date(date): day = os.popen('''date -d "'''+ date + '''" +%a''').read() return day[0:-1] -W_Y = os.popen('''date +"W%U-%Y"''').read()[0:-1] +W_Y = os.popen('''date +"W%V-%Y"''').read()[0:-1] user = os.getlogin() filename = "/home/"+user+"/.cache/Watcher/Analysis/"+W_Y+".csv" with open(filename, "w") as csvfile: @@ -39,7 +39,7 @@ with open(filename, "w") as csvfile: for i in dates: x, y = rc.extract_data(str(i)) - window_opened += x # smth is wrong here + window_opened += x time_spent += y for x, y in rc.final_report(window_opened, time_spent).items(): csvwriter.writerow([y, x]) |