@@ -18,25 +18,24 @@ def time_format(*args: int) -> List:
18
18
else str (x ), args ))
19
19
return fmt
20
20
21
- def time_conversor (s : float ) -> Tuple [str , int , str ]:
21
+ def time_conversor (s : float ) -> Tuple [str , int ]:
22
22
"""
23
23
Take seconds, and return it in h:m:s format.
24
24
25
25
x seconds -> 00:05:12
26
26
27
27
total_hours, total_minutes are saved in the
28
- csv database. tm to plot, th only to register.
28
+ csv database. rt to plot, th only to register.
29
29
30
30
total_minutes is used to make a groupby using
31
31
pandas when -a are inputted.
32
32
"""
33
33
h = int (s / 3600 )
34
- total_hours = f'{ (s / 3600 ):.2f} '
35
34
total_minutes = int (s / 60 )
36
35
m = int (s / 60 ) - h * 60 # Rest
37
36
s = int (s - total_minutes * 60 )
38
37
h , m , s = time_format (h , m , s )
39
- return f'{ h } :{ m } :{ s } ' , total_minutes , total_hours
38
+ return f'{ h } :{ m } :{ s } ' , total_minutes
40
39
41
40
42
41
def make_files (s , cache :str , csv :str ) -> NoReturn :
@@ -66,7 +65,7 @@ def analyze(workcsv: str) -> NoReturn:
66
65
set_loglevel ('error' ) # Hide terminal warnings
67
66
df = pd .read_csv (workcsv )
68
67
df = df .drop (columns = ['message' ], axis = 1 )
69
- df = df .drop (columns = ['hours ' ], axis = 1 )
68
+ df = df .drop (columns = ['real_time ' ], axis = 1 )
70
69
fdf = df .groupby (['date' ]).sum ()
71
70
plt .style .use ('seaborn-dark' )
72
71
@@ -131,12 +130,12 @@ def work(s, e, m, sv, a):
131
130
date_time = datetime (cache_time ['year' ], cache_time ['month' ],
132
131
cache_time ['day' ], cache_time ['hour' ], cache_time ['minute' ])
133
132
delta = now - date_time
134
- time , total_minutes , total_hours = time_conversor (delta .total_seconds ())
135
- print (f'Time worked: { time } ' )
133
+ real_time , total_minutes = time_conversor (delta .total_seconds ())
134
+ print (f'Time worked: { real_time } ' )
136
135
if sv :
137
136
date = date_time .date ()
138
137
csv = pd .read_csv (workcsv )
139
- csv .loc [len (csv .index )] = [date , total_minutes , total_hours , m ]
138
+ csv .loc [len (csv .index )] = [date , total_minutes , real_time , m ]
140
139
with open (workcsv , 'w' ) as file :
141
140
file .write (csv .to_csv (index = False ))
142
141
del_cache (cache )
0 commit comments