From 80a7babc0c6e850f2de7572ebc94729ee24fcde3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 27 Oct 2019 14:48:27 +0100 Subject: Type curses windows --- poezio/tabs/basetabs.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'poezio/tabs') diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 0cae3c6a..2efc77a0 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -21,7 +21,15 @@ import time from math import ceil, log10 from datetime import datetime from xml.etree import cElementTree as ET -from typing import Any, Callable, Dict, List, Optional, Union +from typing import ( + Any, + Callable, + Dict, + List, + Optional, + Union, + TYPE_CHECKING, +) from poezio import mam, poopt, timed_events, xhtml, windows from poezio.core.structs import Command, Completion, Status @@ -35,6 +43,9 @@ from poezio.windows.funcs import truncate_nick from slixmpp import JID, InvalidJID, Message +if TYPE_CHECKING: + from _curses import _CursesWindow + log = logging.getLogger(__name__) # getters for tab colors (lambdas, so that they are dynamic) @@ -176,7 +187,7 @@ class Tab: self._state = 'normal' @staticmethod - def resize(scr): + def resize(scr: '_CursesWindow'): Tab.height, Tab.width = scr.getmaxyx() windows.base_wins.TAB_WIN = scr -- cgit v1.2.3