From c9e219c1405604f2ef81b3e446cc33a0492af42d Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 28 May 2020 21:31:18 +0200 Subject: mypy: Reduce errors on muctab.py by a lot --- poezio/windows/info_wins.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'poezio/windows/info_wins.py') diff --git a/poezio/windows/info_wins.py b/poezio/windows/info_wins.py index d31130fe..c3975c8c 100644 --- a/poezio/windows/info_wins.py +++ b/poezio/windows/info_wins.py @@ -3,6 +3,8 @@ Module defining all the "info wins", ie the bar which is on top of the info buffer in normal tabs """ +from typing import Optional, Dict, TYPE_CHECKING, Any + import logging log = logging.getLogger(__name__) @@ -13,6 +15,11 @@ from poezio.windows.base_wins import Win from poezio.ui.funcs import truncate_nick from poezio.theming import get_theme, to_curses_attr +if TYPE_CHECKING: + from poezio.user import User + from poezio.tabs import MucTab + from poezio.windows import TextWin + class InfoWin(Win): """ @@ -260,10 +267,16 @@ class MucInfoWin(InfoWin): __slots__ = () - def __init__(self): + def __init__(self) -> None: InfoWin.__init__(self) - def refresh(self, room, window=None, user=None, information=None): + def refresh( + self, + room: 'MucTab', + window: Optional['TextWin'] = None, + user: Optional['User'] = None, + information: Optional[Dict[str, Any]] = None + ) -> None: log.debug('Refresh: %s', self.__class__.__name__) self._win.erase() self.write_room_name(room) -- cgit v1.2.3