aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/console/grideditor/base.py28
-rw-r--r--mitmproxy/contrib/tnetstring.py3
2 files changed, 15 insertions, 16 deletions
diff --git a/mitmproxy/console/grideditor/base.py b/mitmproxy/console/grideditor/base.py
index 12c1b3c1..de1c0cf6 100644
--- a/mitmproxy/console/grideditor/base.py
+++ b/mitmproxy/console/grideditor/base.py
@@ -23,6 +23,18 @@ FOOTER_EDITING = [
]
+class Cell(urwid.WidgetWrap):
+ def get_data(self):
+ """
+ Raises:
+ ValueError, if the current content is invalid.
+ """
+ raise NotImplementedError()
+
+ def selectable(self):
+ return True
+
+
class Column(object, metaclass=abc.ABCMeta):
subeditor = None
@@ -45,24 +57,12 @@ class Column(object, metaclass=abc.ABCMeta):
return key
-class Cell(urwid.WidgetWrap):
- def get_data(self):
- """
- Raises:
- ValueError, if the current content is invalid.
- """
- raise NotImplementedError()
-
- def selectable(self):
- return True
-
-
class GridRow(urwid.WidgetWrap):
def __init__(
self,
focused: Optional[int],
editing: bool,
- editor: GridEditor,
+ editor: "GridEditor",
values: Tuple[Iterable[bytes], Container[int]]
):
self.focused = focused
@@ -117,7 +117,7 @@ class GridWalker(urwid.ListWalker):
def __init__(
self,
lst: Iterable[list],
- editor: GridEditor
+ editor: "GridEditor"
):
self.lst = [(i, set()) for i in lst]
self.editor = editor
diff --git a/mitmproxy/contrib/tnetstring.py b/mitmproxy/contrib/tnetstring.py
index 65b64058..24ce6ce8 100644
--- a/mitmproxy/contrib/tnetstring.py
+++ b/mitmproxy/contrib/tnetstring.py
@@ -183,8 +183,7 @@ def load(file_handle: io.BinaryIO) -> TSerializable:
return parse(data_type, data)
-def parse(data_type: int, data: bytes):
- # type: (int, bytes) -> TSerializable
+def parse(data_type: int, data: bytes) -> TSerializable:
if data_type == ord(b','):
return data
if data_type == ord(b';'):