-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
61 lines (47 loc) · 2.01 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
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager
from kivymd.app import MDApp
from components.baseclass import splash, login, dashboard, register, studentlist, profile, about, studentinfo, dummy
from kivy.config import Config
from kivy.properties import NumericProperty, StringProperty, ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.toast import toast
class ContentNavigationDrawer(BoxLayout):
nav_drawer = ObjectProperty()
@staticmethod
def soon():
toast('This app is not yet available')
class MyScreenManager(ScreenManager):
pass
sm = MyScreenManager()
class MyApp(MDApp):
current_button = NumericProperty() # Index of pressed button in dashboard
current_user = NumericProperty() # Index of PROF/USER
current_subject = StringProperty('') # Subject name
current_course_year = StringProperty('') # Course and year
current_prof = StringProperty('') # Name of prof
current_prof_email = StringProperty('') # Email of prof
current_student = StringProperty('') # Name of student
current_student_id = NumericProperty() # Index of student in student list
current_update = NumericProperty() # Index of a section when updating it
current_delete = NumericProperty() # Index of a section when deleting it
dialog = None
pick_time = ObjectProperty()
updated_time = ObjectProperty()
def __init__(self, **kwargs):
self.title = "Facial Recognition"
self.icon = 'logo.png'
super().__init__(**kwargs)
self.theme_cls.primary_palette = 'Blue'
def build(self):
self.mainkv = Builder.load_file("main.kv")
return self.mainkv
def show_screen(self, name):
self.root.current = 'nav_layout_screen'
self.root.get_screen('nav_layout_screen').ids.sm.current = name
if __name__ == "__main__":
Config.set('graphics', 'resizable', 1)
Config.set("graphics", "width", "380")
Config.set("graphics", "height", "620")
Config.write()
MyApp().run()