Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions archinstall/tui/curses_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from curses.ascii import isprint
from curses.textpad import Textbox
from types import FrameType, TracebackType
from typing import Literal, override
from typing import ClassVar, Literal, Self, override

from archinstall.lib.translationhandler import tr

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


class Tui:
_t: Tui | None = None
_t: ClassVar[Self | None] = None

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

@staticmethod
def t() -> 'Tui':
assert Tui._t is not None
return Tui._t
@classmethod
def t(cls) -> Self:
assert cls._t is not None
return cls._t

@staticmethod
def shutdown() -> None:
Expand All @@ -1266,7 +1266,7 @@ def shutdown() -> None:

Tui.t().stop()

def init(self) -> 'Tui':
def init(self) -> Self:
self._screen = curses.initscr()
curses.noecho()
curses.cbreak()
Expand Down