-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
101 lines (79 loc) · 2.57 KB
/
main.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
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.core.window import Window
from kivy.uix.label import Label
from kivy.uix.scrollview import ScrollView
# from kivy.lang.builder import Builder
class Gerenciador(ScreenManager):
pass
class TrancarMatricula(Screen):
pass
class AutenticacaoSeguranca(Screen):
pass
class ConsultarMatricula(Screen):
pass
class Historico(Screen):
pass
class Horario(Screen):
pass
class Notas(Screen):
pass
class Faltas(Screen):
pass
class Cadastro(Screen):
def on_pre_enter(self):
Window.bind(on_keyboard=self.tecla)
def tecla(self, window, key, *args):
if key == 27:
App.get_running_app().root.current = 'menu'
if key == 13:
if (self.ids.cpf.text != '' or self.ids.email.text != '' or self.ids.senha.text != '') and (self.ids.senha.text == self.ids.confsenha.text):
self.manager.transition.direction = 'left'
App.get_running_app().root.current = 'painel'
else:
print("Favor, preencha todas os campos")
return True
def on_pre_leave(self):
Window.unbind(on_keyboard=self.tecla)
class RecoverPass(Screen):
def on_pre_enter(self):
Window.bind(on_keyboard=self.voltar)
def voltar(self, window, key, *args):
if key == 27:
App.get_running_app().root.current = 'menu'
if key == 13:
if self.ids.email.text == '':
print("Favor, preencha o campo de e-mail corretamente")
return True
def on_pre_leave(self):
Window.unbind(on_keyboard=self.voltar)
class Painel(Screen):
def on_pre_enter(self):
Window.bind(on_keyboard=self.voltar)
def voltar(self, window, key, *args):
if key == 27:
App.get_running_app().root.current = 'menu'
return True
def on_pre_leave(self):
Window.unbind(on_keyboard=self.voltar)
class Menu(Screen):
def on_pre_enter(self):
Window.bind(on_keyboard=self.entrar)
def entrar(self, window, key, *args):
if key == 13:
print (window)
if self.ids.email.text == 'admin' and self.ids.senha.text == 'admin':
self.ids.email.text = self.ids.senha.text = ''
self.manager.transition.direction = 'left'
App.get_running_app().root.current = 'painel'
else:
print("Favor, preencha o campo de e-mail corretamente")
return True
def on_pre_leave(self):
Window.unbind(on_keyboard=self.entrar)
class SystemControlEvasion(App):
def build(self):
# Builder.load_string(open('systemcontrolevasion.kv', encoding="utf-8").read(), rulesonly=True)
return Gerenciador()
SystemControlEvasion().run()