-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtkman.py
More file actions
32 lines (30 loc) · 920 Bytes
/
tkman.py
File metadata and controls
32 lines (30 loc) · 920 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
30
31
32
class Tkman:
def __init__(self,tk_id,deta_man):
try:
self.xtk_id = tk_id
self.deta_ctrl = deta_man
self.tk_data = self.deta_ctrl.get(tk_id)
print(self.tk_data)
except ValueError:
print("token error")
self.tk_data = None
self.tk_stat = None
else:
if self.tk_data == None:
self.tk_stat = None
else:
self.tk_stat = self.tk_data["tkstatus"]
print(self.tk_data)
def isValid(self):
if self.tk_stat == True:
return False
if self.tk_stat == False:
return True
if self.tk_stat == None:
return None
def validate(self):
if self.tk_data == None:
return False
else:
self.deta_ctrl.update({"tkstatus":True},self.xtk_id)
return True