-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClient_Functions.py
131 lines (86 loc) · 3.21 KB
/
Client_Functions.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import sys
import main
import Server_Connection
class Credential_Functions:
def __init__(self, credential_function, user_Id, user_password):
match credential_function:
case "R":
self.__Register(user_Id, user_password)
case "L":
self.__Log_In(user_Id, user_password)
case "_L":
self.__Log_Out(user_Id, user_password)
def __Log_In(self, user_Id, user_password):
try:
connection = Server_Connection.Functional_Server_Connection(user_Id, user_password)
connection.Log_In_Server_Connection()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)
def __Log_Out(self, user_Id, user_password):
try:
connection = Server_Connection.Functional_Server_Connection(user_Id, user_password)
connection.Log_Out_Server_Connection()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)
def __Register(self, user_Id, user_password):
try:
connection = Server_Connection.Functional_Server_Connection(user_Id, user_password)
connection.Registration_Server_Connection()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)
class Profile_Functions:
id = ""
password = ""
def __init__(self, user_id, user_password):
self.id = user_id
self.password = user_password
def Load_Profile_Picture(self):
try:
connection = Server_Connection.Functional_Server_Connection(self.id, self.password)
connection.Load_Profile_Picture()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)
class Contacts_Functions:
id = ""
password = ""
def __init__(self, user_id, user_password):
self.id = user_id
self.password = user_password
def Load_Contacts(self):
try:
connection = Server_Connection.Functional_Server_Connection(self.id, self.password)
connection.Load_Contacts()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)
class Grades_Function:
id = ""
password = ""
def __init__(self, user_id, user_password):
self.id = user_id
self.password = user_password
def Load_Grades(self):
try:
connection = Server_Connection.Functional_Server_Connection(self.id, self.password)
connection.Load_Grades()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)
class Material_Function:
id = ""
password = ""
subject = 0
def __init__(self, user_id, user_password):
self.id = user_id
self.password = user_password
def Load_Materials(self):
try:
connection = Server_Connection.Functional_Server_Connection(self.id, self.password)
connection.Load_Materials_Info()
except KeyboardInterrupt:
main.SYSTEM_EXIT = True
sys.exit(0)