diff options
author | 2022-03-18 10:22:28 +0530 | |
---|---|---|
committer | 2022-03-18 10:22:28 +0530 | |
commit | 4c53701e1505273ff96ac4158aaf5df339c20b16 (patch) | |
tree | 83faf76da946b19585b466a8ecdeb12398efbfef /src | |
parent | 4dbb79f5c9ed831cf38cfa41919d477259aa35c3 (diff) | |
download | shopno-os-log-sync-4c53701e1505273ff96ac4158aaf5df339c20b16.tar.gz shopno-os-log-sync-4c53701e1505273ff96ac4158aaf5df339c20b16.zip |
issue resolved : watch_log stoped working after 24:00
Diffstat (limited to 'src')
-rwxr-xr-x | src/Watcher/watch_log.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Watcher/watch_log.py b/src/Watcher/watch_log.py index 589100e..46abc15 100755 --- a/src/Watcher/watch_log.py +++ b/src/Watcher/watch_log.py @@ -35,6 +35,13 @@ def append_line_in_csv(date, closed_time, window_name): afk = False def log_creation(): global afk + + filename = "/home/"+os.getlogin()+"/.cache/Watcher/raw_data/"+get_date()+".csv" + if not(os.path.isfile(filename)): + with open(filename, 'a') as csvfile: + csvwriter = csv.writer(csvfile, delimiter='\t') + csvwriter.writerow([get_time(), "00:00:00", ""]) + append_line_in_csv(get_date(), get_time(), "User-logged-in") while True: filename = "/home/"+os.getlogin()+"/.cache/Watcher/raw_data/"+get_date()+".csv" |