forked from KalleHallden/Calendar_Automator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.py
More file actions
29 lines (23 loc) · 763 Bytes
/
Copy pathtask.py
File metadata and controls
29 lines (23 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import datetime
class Task:
total_time = 0
date = datetime.datetime.now()
def __init__(self, name, start_time, end_time, color):
self.name=name
self.start_time=start_time
self.end_time=end_time
self.color=color
def get_time_of_task(self):
self.total_time = self.end_time - self.start_time
def make_int(self,time):
arr = []
for line in time:
if line.strip():
try: # line contains eol character(s)
n = int(line)
arr.append(n)
except Exception as e:
pass
hour_string = str(arr[0]) + str(arr[1])
int_hour = int(hour_string)
return int_hour