- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmodule.py
More file actions
Latest commit
41 lines (37 loc) · 1.11 KB
/
Copy pathmodule.py
File metadata and controls
41 lines (37 loc) · 1.11 KB
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
importtime
importcontrol
classUser():
"""
This is the blue print of User Instance
"""
user_name=''
user_pw=''
date_created=''
is_admin=False
is_staff=False
is_client=False
all_users= []
def__init__(self):
withopen('data/users.txt','r') asf:
user_data=f.read()
user_list=user_data.strip('\n').split('\n')
self.all_users=user_list
defadd(self,user_name, user_pw):
"""
bla bal
:param user_name:
:param user_pw:
:return:
"""
time_format="%Y-%m-%d %X %A %B %p %r"
time_current=time.strftime(time_format)
self.user_name=user_name
self.user_pw=user_pw
self.date_created=time_current
user_string=f"{self.user_name},{self.user_pw},{self.date_created},{self.is_admin},{self.is_staff},{self.is_client}"
log_message=f"Created new User: {user_string}"
control.logger(log_message)
withopen("data/users.txt",'a') asf:
f.write(user_string)
f.write('\n')
self.__init__()