MCPcopy Index your code
hub / github.com/archlinux/archinstall / LoadingScreen

Class LoadingScreen

archinstall/tui/components.py:78–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78class LoadingScreen(BaseScreen[ValueT]):
79 CSS = """
80 LoadingScreen {
81 align: center middle;
82 background: transparent;
83 }
84
85 .content-container {
86 width: 1fr;
87 height: 1fr;
88 max-height: 100%;
89
90 margin-top: 2;
91 margin-bottom: 2;
92
93 background: transparent;
94 }
95
96 LoadingIndicator {
97 align: center middle;
98 }
99 """
100
101 def __init__(
102 self,
103 timer: int = 3,
104 data_callback: Callable[[], Any] | None = None,
105 header: str | None = None,
106 ):
107 super().__init__()
108 self._timer = timer
109 self._header = header
110 self._data_callback = data_callback
111
112 async def run(self) -> Result[ValueT]:
113 assert TApp.app
114 return await TApp.app.show(self)
115
116 @override
117 def compose(self) -> ComposeResult:
118 with Vertical(classes='content-container'):
119 if self._header:
120 with Center():
121 yield Label(self._header, classes='header', id='loading_header')
122
123 yield Center(LoadingIndicator())
124
125 yield Footer()
126
127 def on_mount(self) -> None:
128 _translate_bindings(self._merged_bindings, self._bindings)
129 if self._data_callback:
130 self._exec_callback()
131 else:
132 self.set_timer(self._timer, self.action_pop_screen)
133
134 self._set_cursor()
135

Callers 3

_setup_wifiMethod · 0.90
_scan_wifiMethod · 0.90
showMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected