-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyTuiDiscord.py
More file actions
34 lines (26 loc) · 1.08 KB
/
PyTuiDiscord.py
File metadata and controls
34 lines (26 loc) · 1.08 KB
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
from textual.app import App, ComposeResult
# Import the LoginScreen from the new screens.py
# Ensure screens.py is in the same directory or adjust python path accordingly
from screens import LoginScreen
# Constants and other specific screen/widget imports are now in screens.py
# network_fuction and asyncio are not directly used by TuiApp in this structure
class TuiApp(App):
CSS_PATH = "pytuidiscord.tcss" # Link the CSS file
TITLE = "PyTuiDiscord"
debug = True # Class variable for debug mode
BINDINGS = [
("d", "toggle_dark", "Toggle dark mode"),
# Consider adding a quit binding e.g. ("ctrl+c", "quit", "Quit")
]
def __init__(self, debug_param: bool = True):
super().__init__()
# The class variable TuiApp.debug is used by default.
# If you want instance-specific debug mode based on the param:
# self.debug = debug_param
def on_ready(self) -> None:
"""Called when the app is ready to run."""
self.push_screen(LoginScreen())
# End of TuiApp class
if __name__ == "__main__":
app = TuiApp()
app.run()