diff options
| author | 2022-03-11 23:40:58 +0530 | |
|---|---|---|
| committer | 2022-03-11 23:40:58 +0530 | |
| commit | 0a411d21a4fe70a6db8496114a6dd49dd4cf345a (patch) | |
| tree | 5828be461f9f0556c1ac4b485906dbfdb29fb40a /src/Watcher/watch_log.py | |
| parent | 76405c161762626fe8aece13c2758f68c837ceb9 (diff) | |
| download | shopno-os-log-sync-0a411d21a4fe70a6db8496114a6dd49dd4cf345a.tar.gz shopno-os-log-sync-0a411d21a4fe70a6db8496114a6dd49dd4cf345a.zip | |
updating executable file and added function in time_operation module
Diffstat (limited to '')
| -rwxr-xr-x | src/Watcher/watch_log.py (renamed from src/Watcher/log_files.py) | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Watcher/log_files.py b/src/Watcher/watch_log.py index 9dfc713..3ac7aa4 100755 --- a/src/Watcher/log_files.py +++ b/src/Watcher/watch_log.py @@ -27,7 +27,6 @@ def append_line_in_csv(date, closed_time, window_name): csvwriter = csv.writer(csvfile, delimiter='\t') csvwriter.writerow(Data) - # Expected Behaviour == if date got changed then append line in new csv file after initializing the csv file # also if usr is AFK then append line @@ -51,4 +50,10 @@ def log_creation(): if __name__ == "__main__": + 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", ""]) + log_creation() |
