-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtask.py
82 lines (58 loc) · 1.89 KB
/
task.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# import geocoder?
import time
import json
class Task:
def __init__(self, task_id, title, desc, creator, in_out_everywhere, task_type,
location, duration, comments, value=1):
self.task_id = task_id
self.title = title
self.description = desc
self.creator = creator
self.in_out_everywhere = in_out_everywhere # in / out / everywhere
self.task_type = task_type # sport & body / be good / adventures / waste my time / culture
self.location = location
self.duration = duration
self.comments = comments
self.value = value
self.creation_time = time.time()
self.do_counter = 0
self.complete_counter = 0
self.del_counter = 0
def get_title(self):
return self.title
def get_id(self):
return self.task_id
def get_description(self):
return self.description
def get_creator(self):
return self.creator
def get_in_out_everywhere(self):
return self.in_out_everywhere
def get_type(self):
return self.task_type
def get_loc(self):
return self.location
def get_duration(self):
return self.duration
def get_value(self):
return self.value
def get_comments(self):
return self.comments
def add_comments(self, user, comment):
self.comments[user] = comment
def get_creation_time(self):
return self.creation_time
def get_do_count(self):
return self.do_counter
def get_done_count(self):
return self.complete_counter
def get_del_count(self):
return self.del_counter
def get_json(self):
return json.dumps(self.__dict__)
def inc_do_count(self):
self.do_counter += 1
def inc_complete_count(self):
self.complete_counter += 1
def inc_del_count(self):
self.del_counter += 1