aboutsummaryrefslogtreecommitdiff
path: root/src/Watcher
diff options
context:
space:
mode:
Diffstat (limited to 'src/Watcher')
-rwxr-xr-xsrc/Watcher/colored_text.py2
-rwxr-xr-xsrc/Watcher/time_operations.py5
-rwxr-xr-xsrc/Watcher/watch_log.py (renamed from src/Watcher/log_files.py)7
3 files changed, 12 insertions, 2 deletions
diff --git a/src/Watcher/colored_text.py b/src/Watcher/colored_text.py
index b143829..162510d 100755
--- a/src/Watcher/colored_text.py
+++ b/src/Watcher/colored_text.py
@@ -1,7 +1,7 @@
class Color:
def GREY(text):
- return '\033[30m' + text + '\033[0m'
+ return '\033[90m' + text + '\033[0m'
def BLUE(text):
return '\033[34m' + text + '\033[0m'
diff --git a/src/Watcher/time_operations.py b/src/Watcher/time_operations.py
index 985a5e8..4145e8d 100755
--- a/src/Watcher/time_operations.py
+++ b/src/Watcher/time_operations.py
@@ -53,3 +53,8 @@ def convert_time(t):
else:
result = t[0:2] + 'h ' + t[3:5] + 'm ' + t[6::] + 's'
return result
+
+def convert_into_sec(t):
+ sec = int(t[0:2])*3600 + int(t[3:5])*60 + int(t[6::])
+ return sec
+
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()