def login_screen(self, event): print('testing login screen') self.log_num = 0 self.login = main.Login(name='login') self.refresh_button.bind(on_press=self.refresh_login) self.login.add_widget(self.refresh_button) sm.add_widget(self.login) sm.current = 'login'
def refresh_login(self, event): print('refreshing') self.login.remove_widget(self.refresh_button) self.log_num += 1 try: importlib.reload(main) self.login = main.Login(name='login%s' % self.log_num) self.login.add_widget(self.refresh_button) sm.add_widget(self.login) sm.current = 'login%s' % self.log_num except Exception as e: self.login.remove_widget(self.refresh_button) self.login.add_widget(self.refresh_button) print('compile error\n- ', e)
def createaccfunction(self): name = self.name.text() name = name.title() age = self.age.text() bloodGroup = self.bloodGroup.currentText() location = self.location.currentText() phoneNumber = self.phoneNo.text() email = self.email.text() if len(name) != 0 and len(age) != 0: if self.password.text() == self.confirmpass.text(): password = self.password.text() if len(password) >= 6: if len(phoneNumber) == 10: try: user = m.auth.create_user_with_email_and_password( email, password) id = user['localId'] data = { 'Name': name, 'Age': age, 'Blood Group': bloodGroup, 'Location': location, 'Phone Number': phoneNumber, 'id': id } m.db.child('Users').child().push(data) # m.auth.sign_in_with_email_and_password(email, password) # home = h.Home() login = m.Login() m.widget.addWidget(login) m.widget.setCurrentIndex(m.widget.currentIndex() + 1) except: self.invalid.setText('Please enter valid email.') self.invalid.setVisible(True) else: self.invalid.setText( 'Please enter valid phone number.') self.invalid.setVisible(True) else: self.invalid.setText('Password must have min 6 letters.') self.invalid.setVisible(True) else: self.invalid.setText('Password not Matching.') self.invalid.setVisible(True) else: self.invalid.setText('Please enter valid Name and Age.') self.invalid.setVisible(True)
def signoutfunction(self): login = m.Login() m.widget.addWidget(login) m.widget.setCurrentIndex(m.widget.currentIndex() + 1)
def backtoMain(self): login = m.Login() m.widget.addWidget(login) m.widget.setCurrentIndex(m.widget.currentIndex() + 1)