-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUserView.py
More file actions
54 lines (40 loc) · 1.15 KB
/
UserView.py
File metadata and controls
54 lines (40 loc) · 1.15 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
42
43
44
45
46
47
48
49
50
51
52
class UserView(object):
@staticmethod
def wrong_option():
print("---")
print("Invalid option")
print("---")
@staticmethod
def display_options():
print("---")
print("Welcome!")
print("1 - Login")
print("2 - Create new user")
return int(input())
print("---")
@staticmethod
def user_created():
print("User created!")
@staticmethod
def get_credentials():
print("Enter your credentials")
login = input("Login: ")
password = input("Password: ")
return {'login' : login, 'password' : password}
@staticmethod
def create_new_user():
name = input("name: ")
login = input("Login: ")
password = input("Passoword: ")
return {'name' : name, 'login' : login, 'password' : password}
@staticmethod
def user_not_found():
print("This user does not exist")
@staticmethod
def user_exists():
print("User already exists")
@staticmethod
def render_all_users(users):
for user in users:
print(user)
print("***")