-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapplication.py
43 lines (34 loc) · 1.11 KB
/
application.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
from login import Login
from eax500 import MainWindow
from settings import Settings
class Application:
"""
This class is used to handle the application state.
"""
def __init__(self):
self.settings = Settings()
self.main_window = MainWindow()
self.login_window = Login(window=self.main_window, settings=self.settings)
self.user = None
self.state = "Logged Out"
if self.settings.get("skip_login"):
self.transition_to_main()
def transition_to_login(self):
# handle transition to login state
self.state = "Logging In"
def transition_to_main(self):
# handle transition to main window state
self.state = "Logged In"
self.main_window.run()
def transition_to_logout(self):
# handle transition to logout state
self.state = "Logged Out"
def transition_to_exit(self):
# handle transition to exit state
self.state = "Exiting"
def get_state(self):
# return the current state
return self.state
def run(self):
# main application loop
pass