-
Notifications
You must be signed in to change notification settings - Fork 0
/
ems_signup.py
29 lines (24 loc) · 899 Bytes
/
ems_signup.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
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.screenmanager import Screen
from kivy.core.window import Window
from kivy.utils import rgba
from colors import Colors
from FirebaseRealtimeDB import create_acct
kv = Builder.load_file('ems_signup.kv')
class EMSSignup(Screen):
def on_pre_enter(self, *args):
self.manager.transition.direction = 'up'
def on_pre_leave(self, *args):
self.manager.transition.direction = 'down'
def valid_credentials(self, email, pw, pw_confirm, ems_id):
if pw.text != pw_confirm.text:
return False
if email.text == '' or ('@' not in email.text) or pw.text == '':
return False
try:
print(email.text, pw.text, pw_confirm.text, ems_id.text)
create_acct(email.text, pw.text)
return True
except:
return False