-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
38 lines (29 loc) · 1023 Bytes
/
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
from services.messaging import Messaging
from components.new_task import NewTaskLayout
from components.task_executions import TaskExecutionsLayout
from components.mojodex import Menu, Mojodex, MenuItem
from services.auth import login
from textual.app import App
import logging
from rich.traceback import install
from rich.logging import RichHandler
logging.basicConfig(
level="ERROR",
format="%(message)s",
datefmt="[%X]",
handlers=[RichHandler(rich_tracebacks=True)]
)
# Install Rich traceback globally to handle exceptions beautifully
install()
user = None
if __name__ == "__main__":
user = login()
app : App = None
main_menu = Menu([
MenuItem("✚ New Task", lambda: NewTaskLayout(id="body_new_task"), id="new_task"),
MenuItem("❖ Tasks", lambda: TaskExecutionsLayout(id="body_task_executions"), id="task_list")
], id='main_menu')
app = Mojodex(main_menu)
Messaging().notify = app.notify
Messaging().start()
app.run()