diff options
author | oscure76 <midhun.nitw@gmail.com> | 2018-04-14 16:24:41 -0700 |
---|---|---|
committer | oscure76 <midhun.nitw@gmail.com> | 2018-04-14 16:24:41 -0700 |
commit | 0e984e1442e735a6a3cee5170bead492b231d620 (patch) | |
tree | 4e0ae4b5598f3c1be35a38819b15a12ace6209c8 /mitmproxy/tools/console/grideditor/base.py | |
parent | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f (diff) | |
download | mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.gz mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.bz2 mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.zip |
fix Python 3.6 variable type annotations #3053
Diffstat (limited to 'mitmproxy/tools/console/grideditor/base.py')
-rw-r--r-- | mitmproxy/tools/console/grideditor/base.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mitmproxy/tools/console/grideditor/base.py b/mitmproxy/tools/console/grideditor/base.py index 204820a8..3badf1a6 100644 --- a/mitmproxy/tools/console/grideditor/base.py +++ b/mitmproxy/tools/console/grideditor/base.py @@ -39,7 +39,7 @@ class Cell(urwid.WidgetWrap): class Column(metaclass=abc.ABCMeta): - subeditor = None # type: urwid.Edit + subeditor: urwid.Edit = None def __init__(self, heading): self.heading = heading @@ -71,10 +71,10 @@ class GridRow(urwid.WidgetWrap): ) -> None: self.focused = focused self.editor = editor - self.edit_col = None # type: typing.Optional[Cell] + self.edit_col: typing.Optional[Cell] = None errors = values[1] - self.fields = [] # type: typing.Sequence[typing.Any] + self.fields: typing.Sequence[typing.Any] = [] for i, v in enumerate(values[0]): if focused == i and editing: self.edit_col = self.editor.columns[i].Edit(v) @@ -123,11 +123,11 @@ class GridWalker(urwid.ListWalker): lst: typing.Iterable[list], editor: "GridEditor" ) -> None: - self.lst = [(i, set()) for i in lst] # type: typing.Sequence[typing.Tuple[typing.Any, typing.Set]] + self.lst: typing.Sequence[typing.Tuple[typing.Any, typing.Set]] = [(i, set()) for i in lst] self.editor = editor self.focus = 0 self.focus_col = 0 - self.edit_row = None # type: typing.Optional[GridRow] + self.edit_row: typing.Optional[GridRow] = None def _modified(self): self.editor.show_empty_msg() @@ -402,8 +402,8 @@ class BaseGridEditor(urwid.WidgetWrap): class GridEditor(BaseGridEditor): - title = None # type: str - columns = None # type: typing.Sequence[Column] + title: str = None + columns: typing.Sequence[Column] = None keyctx = "grideditor" def __init__( |