diff options
author | mathieui <mathieui@mathieui.net> | 2019-10-27 14:48:27 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2019-10-27 14:48:27 +0100 |
commit | 80a7babc0c6e850f2de7572ebc94729ee24fcde3 (patch) | |
tree | 1afe1047c73308da28ff7e1e790ddf51257a5a23 /poezio/windows | |
parent | 2f4651d036658d3ecdff65581c0c7278eca4d5af (diff) | |
download | poezio-80a7babc0c6e850f2de7572ebc94729ee24fcde3.tar.gz poezio-80a7babc0c6e850f2de7572ebc94729ee24fcde3.tar.bz2 poezio-80a7babc0c6e850f2de7572ebc94729ee24fcde3.tar.xz poezio-80a7babc0c6e850f2de7572ebc94729ee24fcde3.zip |
Type curses windows
Diffstat (limited to 'poezio/windows')
-rw-r--r-- | poezio/windows/base_wins.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/poezio/windows/base_wins.py b/poezio/windows/base_wins.py index 6dabd7b8..361ae338 100644 --- a/poezio/windows/base_wins.py +++ b/poezio/windows/base_wins.py @@ -7,7 +7,7 @@ the text window, the roster window, etc. A Tab (see the poezio.tabs module) is composed of multiple Windows """ -TAB_WIN = None +TAB_WIN = None # type: _CursesWindow import logging log = logging.getLogger(__name__) @@ -15,7 +15,8 @@ log = logging.getLogger(__name__) import curses import string -from typing import Optional, Tuple +from contextlib import contextmanager +from typing import Optional, Tuple, TYPE_CHECKING from poezio.theming import to_curses_attr, read_tuple @@ -24,6 +25,9 @@ FORMAT_CHAR = '\x19' # I guess. But maybe we can find better chars that are even less risky. format_chars = '\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x1A' +if TYPE_CHECKING: + from _curses import _CursesWindow + class DummyWin: def __getattribute__(self, name: str): @@ -40,7 +44,7 @@ class Win: __slots__ = ('_win', 'height', 'width', 'y', 'x') def __init__(self) -> None: - self._win = None + self._win = None # type: _CursesWindow self.height, self.width = 0, 0 def _resize(self, height: int, width: int, y: int, x: int) -> None: |