diff options
author | mathieui <mathieui@mathieui.net> | 2018-08-17 02:16:03 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2018-08-17 02:16:03 +0200 |
commit | b4d3b93da2e23cefb85dd98f1f7f9706aa0402d4 (patch) | |
tree | f8c489bbf65a9a4a24d268281d3da798bbfe3ba2 /poezio/windows/base_wins.py | |
parent | 6ccf7ea71d5e5194dd036a90e36c0db6a0ec757a (diff) | |
download | poezio-b4d3b93da2e23cefb85dd98f1f7f9706aa0402d4.tar.gz poezio-b4d3b93da2e23cefb85dd98f1f7f9706aa0402d4.tar.bz2 poezio-b4d3b93da2e23cefb85dd98f1f7f9706aa0402d4.tar.xz poezio-b4d3b93da2e23cefb85dd98f1f7f9706aa0402d4.zip |
Add typing information and reformat stuff
Diffstat (limited to 'poezio/windows/base_wins.py')
-rw-r--r-- | poezio/windows/base_wins.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/poezio/windows/base_wins.py b/poezio/windows/base_wins.py index eaedd82b..89c4b73c 100644 --- a/poezio/windows/base_wins.py +++ b/poezio/windows/base_wins.py @@ -15,6 +15,8 @@ log = logging.getLogger(__name__) import curses import string +from typing import Optional, Tuple + from poezio.theming import to_curses_attr, read_tuple FORMAT_CHAR = '\x19' @@ -51,7 +53,7 @@ class Win: if self._win is None: self._win = DummyWin() - def resize(self, height, width, y, x): + def resize(self, height: int, width: int, y: int, x: int): """ Override if something has to be done on resize """ @@ -81,13 +83,13 @@ class Win: except: pass - def move(self, y, x): + def move(self, y: int, x: int): try: self._win.move(y, x) except: pass - def addstr_colored(self, text, y=None, x=None): + def addstr_colored(self, text: str, y=None, x=None): """ Write a string on the window, setting the attributes as they are in the string. @@ -146,7 +148,7 @@ class Win: next_attr_char = text.find(FORMAT_CHAR) self.addstr(text) - def finish_line(self, color=None): + def finish_line(self, color: Optional[Tuple] = None): """ Write colored spaces until the end of line """ |