aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorHenrique <typoon@gmail.com>2019-11-16 20:15:27 -0500
committerHenrique <typoon@gmail.com>2019-11-16 20:15:27 -0500
commitfbcaab2abaf713d9e11770b0cb22c9068dcef2ae (patch)
tree4037844b886e41a114e6c26abb8508ba56745aff /mitmproxy
parent13fe07f48f4fa191b8596aa94cbe743a3c3344fa (diff)
downloadmitmproxy-fbcaab2abaf713d9e11770b0cb22c9068dcef2ae.tar.gz
mitmproxy-fbcaab2abaf713d9e11770b0cb22c9068dcef2ae.tar.bz2
mitmproxy-fbcaab2abaf713d9e11770b0cb22c9068dcef2ae.zip
Added return signature to methods on commander.py
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/tools/console/commander/commander.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mitmproxy/tools/console/commander/commander.py b/mitmproxy/tools/console/commander/commander.py
index a13e5792..bff58605 100644
--- a/mitmproxy/tools/console/commander/commander.py
+++ b/mitmproxy/tools/console/commander/commander.py
@@ -207,7 +207,7 @@ class CommandEdit(urwid.WidgetWrap):
self.history = history
self.update()
- def keypress(self, size, key):
+ def keypress(self, size, key) -> None:
if key == "backspace":
self.cbuf.backspace()
elif key == "left":
@@ -225,21 +225,21 @@ class CommandEdit(urwid.WidgetWrap):
self.cbuf.insert(key)
self.update()
- def update(self):
+ def update(self) -> None:
self._w.set_text([self.leader, self.cbuf.render()])
- def render(self, size, focus=False):
+ def render(self, size, focus=False) -> urwid.Canvas:
(maxcol,) = size
canv = self._w.render((maxcol,))
canv = urwid.CompositeCanvas(canv)
canv.cursor = self.get_cursor_coords((maxcol,))
return canv
- def get_cursor_coords(self, size):
+ def get_cursor_coords(self, size) -> typing.Tuple[int, int]:
p = self.cbuf.cursor + len(self.leader)
trans = self._w.get_line_translation(size[0])
x, y = calc_coords(self._w.get_text()[0], trans, p)
return x, y
- def get_edit_text(self):
+ def get_edit_text(self) -> str:
return self.cbuf.text