summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-17 18:48:39 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-17 18:48:39 +0100
commit47bd3ab811f0e28e49a78bf5bcddbeb77c570329 (patch)
tree135ceec7ce06b26dc31a910fde611daca009e491
parent176b4ee9d3c1eda120f0c15c4d9f517149b20d1e (diff)
downloadpoezio-47bd3ab811f0e28e49a78bf5bcddbeb77c570329.tar.gz
poezio-47bd3ab811f0e28e49a78bf5bcddbeb77c570329.tar.bz2
poezio-47bd3ab811f0e28e49a78bf5bcddbeb77c570329.tar.xz
poezio-47bd3ab811f0e28e49a78bf5bcddbeb77c570329.zip
windows.misc: Type everything in this module.
-rw-r--r--poezio/windows/misc.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/poezio/windows/misc.py b/poezio/windows/misc.py
index 71027b7c..e6596622 100644
--- a/poezio/windows/misc.py
+++ b/poezio/windows/misc.py
@@ -3,13 +3,15 @@ Wins that don’t fit any category
"""
import logging
-log = logging.getLogger(__name__)
-
import curses
+from typing import List
+
from poezio.windows.base_wins import Win
from poezio.theming import get_theme, to_curses_attr
+log = logging.getLogger(__name__)
+
class VerticalSeparator(Win):
"""
@@ -17,23 +19,23 @@ class VerticalSeparator(Win):
refreshed only on resize, but never on refresh, for efficiency
"""
- def rewrite_line(self):
+ def rewrite_line(self) -> None:
self._win.vline(0, 0, curses.ACS_VLINE, self.height,
to_curses_attr(get_theme().COLOR_VERTICAL_SEPARATOR))
self._refresh()
- def refresh(self):
+ def refresh(self) -> None:
log.debug('Refresh: %s', self.__class__.__name__)
self.rewrite_line()
class SimpleTextWin(Win):
- def __init__(self, text):
+ def __init__(self, text) -> None:
Win.__init__(self)
self._text = text
- self.built_lines = []
+ self.built_lines = [] # type: List[str]
- def rebuild_text(self):
+ def rebuild_text(self) -> None:
"""
Transform the text in lines than can then be
displayed without any calculation or anything
@@ -50,7 +52,7 @@ class SimpleTextWin(Win):
line = line[limit:]
self.built_lines.append(line)
- def refresh(self):
+ def refresh(self) -> None:
log.debug('Refresh: %s', self.__class__.__name__)
self._win.erase()
for y, line in enumerate(self.built_lines):