- Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCreateAccount.py
More file actions
Latest commit
70 lines (53 loc) · 3.08 KB
/
Copy pathCreateAccount.py
File metadata and controls
70 lines (53 loc) · 3.08 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#CreateAccount.py
fromPyQt5.QtWidgetsimportQMainWindow, QFileDialog
fromPyQt5importQtWidgets
fromPyQt5.QtGuiimportQPixmap
importre# for regular expressions and used to validate email
fromPyQt5.uicimportloadUi
fromMainpageimportMainScreen
importsqlite3
classCreateAccountScreen(QMainWindow):
def__init__(self, widget):
super(CreateAccountScreen, self).__init__()
loadUi("CreateAccount.ui", self)
self.widget=widget
#### HIDING PASSWORD FIELD IN THE CREATEACCOUNT PAGE ####
self.Password_LineEdit.setEchoMode(QtWidgets.QLineEdit.Password)
#### SUBMIT BUTTON THAT LEADS TO THE MAINPAGE ####
self.submit_Button.clicked.connect(self.Submit)
## BUTTTON TO UPLOAD A PICTURE ###
self.Upload_Picture_button.clicked.connect(self.uploadImage)
#########################################################################################
## METHOD THAT VERIFIES IF THE USERNAME THE USER IS ENTERING IS NOT YET TAKEN ##
#########################################################################################
defisUsernameTaken(self, username):
try:
conn=sqlite3.connect("usersInfo.db")
cursor=conn.cursor()
cursor.execute("SELECT Username FROM Users WHERE Username = ?", (username,))
result=cursor.fetchone()
conn.close()
returnresultisnotNone
exceptExceptionase:
print(f"Error checking username existence: {str(e)}")
returnFalse
########################################################################################
## METHOD TO CHECK IF THE USER INFO IS ENTERED IN THE CORRECT FORMAT ##
########################################################################################
defCheckInfo(self, username, email, password, age, phonenumber, location, gender):
pass
#############################################################################################
## METHOD THAT STORES USER INFO IN THE DATABASE AFTER VALIDATION ##
#############################################################################################
defstoreInDataBase(self, username, email, password, age, phonenumber, location,gender, image_path):
pass
##############################################################################################
## METHOD THAT ALLOWS USER TO UPLOAD AN IMAGE FOR HIS PROFILE ##
##############################################################################################
defuploadImage(self):
pass
####################################################################################################
## THE FINAL SUBMIT BUTTON THAT VERIFIES ALL THE OTHER METHODS, THEN MOVES TO THE MAINPAGE ##
####################################################################################################
defSubmit(self):
pass