summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-17 17:28:06 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-17 18:36:53 +0100
commitc2dbaba41fc35092a361e8d839b37abfdec12947 (patch)
treee86ebf5e09dbdda381b16f9ea8b02c7a526ab7ea
parentdb230d0b3ef397627d904ce6104c91a87326b8a6 (diff)
downloadpoezio-c2dbaba41fc35092a361e8d839b37abfdec12947.tar.gz
poezio-c2dbaba41fc35092a361e8d839b37abfdec12947.tar.bz2
poezio-c2dbaba41fc35092a361e8d839b37abfdec12947.tar.xz
poezio-c2dbaba41fc35092a361e8d839b37abfdec12947.zip
windows.base_wins: Type almost everything in this module.
-rw-r--r--poezio/windows/base_wins.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/poezio/windows/base_wins.py b/poezio/windows/base_wins.py
index 89c4b73c..b14b44c3 100644
--- a/poezio/windows/base_wins.py
+++ b/poezio/windows/base_wins.py
@@ -26,22 +26,22 @@ format_chars = '\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x1A'
class DummyWin:
- def __getattribute__(self, name):
+ def __getattribute__(self, name: str):
if name != '__bool__':
return lambda *args, **kwargs: (0, 0)
else:
return object.__getattribute__(self, name)
- def __bool__(self):
+ def __bool__(self) -> bool:
return False
class Win:
- def __init__(self):
+ def __init__(self) -> None:
self._win = None
self.height, self.width = 0, 0
- def _resize(self, height, width, y, x):
+ def _resize(self, height: int, width: int, y: int, x: int) -> None:
if height == 0 or width == 0:
self.height, self.width = height, width
return
@@ -53,16 +53,16 @@ class Win:
if self._win is None:
self._win = DummyWin()
- def resize(self, height: int, width: int, y: int, x: int):
+ def resize(self, height: int, width: int, y: int, x: int) -> None:
"""
Override if something has to be done on resize
"""
self._resize(height, width, y, x)
- def _refresh(self):
+ def _refresh(self) -> None:
self._win.noutrefresh()
- def addnstr(self, *args):
+ def addnstr(self, *args) -> None:
"""
Safe call to addnstr
"""
@@ -74,7 +74,7 @@ class Win:
# of the screen.
pass
- def addstr(self, *args):
+ def addstr(self, *args) -> None:
"""
Safe call to addstr
"""
@@ -83,13 +83,13 @@ class Win:
except:
pass
- def move(self, y: int, x: int):
+ def move(self, y: int, x: int) -> None:
try:
self._win.move(y, x)
except:
pass
- def addstr_colored(self, text: str, y=None, x=None):
+ def addstr_colored(self, text: str, y: Optional[int] = None, x: Optional[int] = None) -> None:
"""
Write a string on the window, setting the
attributes as they are in the string.
@@ -148,7 +148,7 @@ class Win:
next_attr_char = text.find(FORMAT_CHAR)
self.addstr(text)
- def finish_line(self, color: Optional[Tuple] = None):
+ def finish_line(self, color: Optional[Tuple] = None) -> None:
"""
Write colored spaces until the end of line
"""