mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Fixed linting issues
This commit is contained in:
parent
2cc2fafd2e
commit
df06c4da3b
@ -1,5 +1,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
def common_options(parser, opts):
|
def common_options(parser, opts):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--version',
|
'--version',
|
||||||
|
@ -266,6 +266,7 @@ def colorize_url(url):
|
|||||||
('url_punctuation', 3), # ://
|
('url_punctuation', 3), # ://
|
||||||
] + colorize_host(parts[2]) + colorize_req('/' + parts[3])
|
] + colorize_host(parts[2]) + colorize_req('/' + parts[3])
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=800)
|
@lru_cache(maxsize=800)
|
||||||
def raw_format_list(f):
|
def raw_format_list(f):
|
||||||
f = dict(f)
|
f = dict(f)
|
||||||
@ -353,6 +354,7 @@ def raw_format_list(f):
|
|||||||
pile.append(urwid.Columns(resp, dividechars=1))
|
pile.append(urwid.Columns(resp, dividechars=1))
|
||||||
return urwid.Pile(pile)
|
return urwid.Pile(pile)
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=800)
|
@lru_cache(maxsize=800)
|
||||||
def raw_format_table(f):
|
def raw_format_table(f):
|
||||||
f = dict(f)
|
f = dict(f)
|
||||||
@ -547,9 +549,9 @@ def format_flow(f, focus, extended=False, hostheader=False, cols=False, layout='
|
|||||||
resp_ctype=f.response.headers.get("content-type"),
|
resp_ctype=f.response.headers.get("content-type"),
|
||||||
resp_clen=contentdesc,
|
resp_clen=contentdesc,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
))
|
))
|
||||||
|
|
||||||
if ( (layout == 'default' and cols < 80) or layout == "list"):
|
if ((layout == 'default' and cols < 80) or layout == "list"):
|
||||||
return raw_format_list(tuple(sorted(d.items())))
|
return raw_format_list(tuple(sorted(d.items())))
|
||||||
else:
|
else:
|
||||||
return raw_format_table(tuple(sorted(d.items())))
|
return raw_format_table(tuple(sorted(d.items())))
|
||||||
|
@ -121,11 +121,10 @@ class ConsoleAddon:
|
|||||||
)
|
)
|
||||||
|
|
||||||
loader.add_option(
|
loader.add_option(
|
||||||
"console_flowlist_layout",
|
"console_flowlist_layout",
|
||||||
str, "default",
|
str, "default",
|
||||||
"Set the flowlist layout",
|
"Set the flowlist layout",
|
||||||
choices=sorted(console_flowlist_layout)
|
choices=sorted(console_flowlist_layout)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@command.command("console.layout.options")
|
@command.command("console.layout.options")
|
||||||
|
@ -90,7 +90,6 @@ class FlowListBox(urwid.ListBox, layoutwidget.LayoutWidget):
|
|||||||
["console_flowlist_layout"]
|
["console_flowlist_layout"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def keypress(self, size, key):
|
def keypress(self, size, key):
|
||||||
if key == "m_start":
|
if key == "m_start":
|
||||||
self.master.commands.execute("view.focus.go 0")
|
self.master.commands.execute("view.focus.go 0")
|
||||||
@ -105,4 +104,3 @@ class FlowListBox(urwid.ListBox, layoutwidget.LayoutWidget):
|
|||||||
|
|
||||||
def set_flowlist_layout(self, opts, updated):
|
def set_flowlist_layout(self, opts, updated):
|
||||||
self.master.ui.clear()
|
self.master.ui.clear()
|
||||||
|
|
||||||
|
@ -225,10 +225,10 @@ class LowLight(Palette):
|
|||||||
method_get = ('dark green', 'default'),
|
method_get = ('dark green', 'default'),
|
||||||
method_post = ('brown', 'default'),
|
method_post = ('brown', 'default'),
|
||||||
method_head = ('dark cyan', 'default'),
|
method_head = ('dark cyan', 'default'),
|
||||||
method_put = ('light red', 'default'),
|
method_put = ('light red', 'default'),
|
||||||
method_delete = ('dark red', 'default'),
|
method_delete = ('dark red', 'default'),
|
||||||
method_other = ('light magenta', 'default'),
|
method_other = ('light magenta', 'default'),
|
||||||
method_http2_push = ('light gray','default'),
|
method_http2_push = ('light gray', 'default'),
|
||||||
|
|
||||||
scheme_http = ('dark cyan', 'default'),
|
scheme_http = ('dark cyan', 'default'),
|
||||||
scheme_https = ('light green', 'default'),
|
scheme_https = ('light green', 'default'),
|
||||||
@ -344,10 +344,10 @@ class SolarizedLight(LowLight):
|
|||||||
method_get = (sol_green, 'default'),
|
method_get = (sol_green, 'default'),
|
||||||
method_post = (sol_orange, 'default'),
|
method_post = (sol_orange, 'default'),
|
||||||
method_head = (sol_cyan, 'default'),
|
method_head = (sol_cyan, 'default'),
|
||||||
method_put = (sol_red, 'default'),
|
method_put = (sol_red, 'default'),
|
||||||
method_delete = (sol_red, 'default'),
|
method_delete = (sol_red, 'default'),
|
||||||
method_other = (sol_magenta, 'default'),
|
method_other = (sol_magenta, 'default'),
|
||||||
method_http2_push = ('light gray','default'),
|
method_http2_push = ('light gray', 'default'),
|
||||||
|
|
||||||
scheme_http = (sol_cyan, 'default'),
|
scheme_http = (sol_cyan, 'default'),
|
||||||
scheme_https = ('light green', 'default'),
|
scheme_https = ('light green', 'default'),
|
||||||
|
Loading…
Reference in New Issue
Block a user