Skip to content

Commit cf23699

Browse files
committed
Use Self for Tui
1 parent 2c85b5e commit cf23699

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

archinstall/tui/curses_menu.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from curses.ascii import isprint
1010
from curses.textpad import Textbox
1111
from types import FrameType, TracebackType
12-
from typing import Literal, override
12+
from typing import ClassVar, Literal, Self, override
1313

1414
from archinstall.lib.translationhandler import tr
1515

@@ -1240,7 +1240,7 @@ def _focus_item(self, direction: Literal['next', 'prev', 'first', 'last']) -> No
12401240

12411241

12421242
class Tui:
1243-
_t: Tui | None = None
1243+
_t: ClassVar[Self | None] = None
12441244

12451245
def __enter__(self) -> None:
12461246
if Tui._t is None:
@@ -1254,10 +1254,10 @@ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseExceptio
12541254
def screen(self) -> curses.window:
12551255
return self._screen
12561256

1257-
@staticmethod
1258-
def t() -> 'Tui':
1259-
assert Tui._t is not None
1260-
return Tui._t
1257+
@classmethod
1258+
def t(cls) -> Self:
1259+
assert cls._t is not None
1260+
return cls._t
12611261

12621262
@staticmethod
12631263
def shutdown() -> None:
@@ -1266,7 +1266,7 @@ def shutdown() -> None:
12661266

12671267
Tui.t().stop()
12681268

1269-
def init(self) -> 'Tui':
1269+
def init(self) -> Self:
12701270
self._screen = curses.initscr()
12711271
curses.noecho()
12721272
curses.cbreak()

0 commit comments

Comments
 (0)