aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesson Soto Ventura <jessonsotoventura@gmail.com>2019-07-21 14:11:37 -0400
committerJesson Soto Ventura <jessonsotoventura@gmail.com>2019-07-21 14:11:37 -0400
commitdf06c4da3b43f425f08afdfd3b12209f9fb84f01 (patch)
tree75b9df287a839c93520294c37f2cbcd3e8d30518
parent2cc2fafd2e76b1f66cf2fa7ad93a5c4636eee6a8 (diff)
downloadmitmproxy-df06c4da3b43f425f08afdfd3b12209f9fb84f01.tar.gz
mitmproxy-df06c4da3b43f425f08afdfd3b12209f9fb84f01.tar.bz2
mitmproxy-df06c4da3b43f425f08afdfd3b12209f9fb84f01.zip
Fixed linting issues
-rw-r--r--mitmproxy/addons/block.py2
-rw-r--r--mitmproxy/tools/cmdline.py1
-rw-r--r--mitmproxy/tools/console/commandexecutor.py2
-rw-r--r--mitmproxy/tools/console/common.py6
-rw-r--r--mitmproxy/tools/console/consoleaddons.py11
-rw-r--r--mitmproxy/tools/console/flowlist.py2
-rw-r--r--mitmproxy/tools/console/palettes.py10
7 files changed, 17 insertions, 17 deletions
diff --git a/mitmproxy/addons/block.py b/mitmproxy/addons/block.py
index 91f9f709..4ccde0e1 100644
--- a/mitmproxy/addons/block.py
+++ b/mitmproxy/addons/block.py
@@ -36,4 +36,4 @@ class Block:
layer.reply.kill()
if ctx.options.block_global and address.is_global:
ctx.log.warn("Client connection from %s killed by block_global" % astr)
- layer.reply.kill() \ No newline at end of file
+ layer.reply.kill()
diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py
index 21369a1f..eb4a984d 100644
--- a/mitmproxy/tools/cmdline.py
+++ b/mitmproxy/tools/cmdline.py
@@ -1,5 +1,6 @@
import argparse
+
def common_options(parser, opts):
parser.add_argument(
'--version',
diff --git a/mitmproxy/tools/console/commandexecutor.py b/mitmproxy/tools/console/commandexecutor.py
index 3db03d3e..c738e349 100644
--- a/mitmproxy/tools/console/commandexecutor.py
+++ b/mitmproxy/tools/console/commandexecutor.py
@@ -34,4 +34,4 @@ class CommandExecutor:
ret,
),
valign="top"
- ) \ No newline at end of file
+ )
diff --git a/mitmproxy/tools/console/common.py b/mitmproxy/tools/console/common.py
index ee2e2a76..f13c876b 100644
--- a/mitmproxy/tools/console/common.py
+++ b/mitmproxy/tools/console/common.py
@@ -266,6 +266,7 @@ def colorize_url(url):
('url_punctuation', 3), # ://
] + colorize_host(parts[2]) + colorize_req('/' + parts[3])
+
@lru_cache(maxsize=800)
def raw_format_list(f):
f = dict(f)
@@ -353,6 +354,7 @@ def raw_format_list(f):
pile.append(urwid.Columns(resp, dividechars=1))
return urwid.Pile(pile)
+
@lru_cache(maxsize=800)
def raw_format_table(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_clen=contentdesc,
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())))
else:
return raw_format_table(tuple(sorted(d.items())))
diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py
index 0f7383f6..13f3ff7d 100644
--- a/mitmproxy/tools/console/consoleaddons.py
+++ b/mitmproxy/tools/console/consoleaddons.py
@@ -120,12 +120,11 @@ class ConsoleAddon:
"Console mouse interaction."
)
- loader.add_option(
- "console_flowlist_layout",
- str, "default",
- "Set the flowlist layout",
- choices=sorted(console_flowlist_layout)
-
+ loader.add_option(
+ "console_flowlist_layout",
+ str, "default",
+ "Set the flowlist layout",
+ choices=sorted(console_flowlist_layout)
)
@command.command("console.layout.options")
diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py
index 64c5e10c..9650c0d3 100644
--- a/mitmproxy/tools/console/flowlist.py
+++ b/mitmproxy/tools/console/flowlist.py
@@ -90,7 +90,6 @@ class FlowListBox(urwid.ListBox, layoutwidget.LayoutWidget):
["console_flowlist_layout"]
)
-
def keypress(self, size, key):
if key == "m_start":
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):
self.master.ui.clear()
-
diff --git a/mitmproxy/tools/console/palettes.py b/mitmproxy/tools/console/palettes.py
index 2a7f1254..4eee7692 100644
--- a/mitmproxy/tools/console/palettes.py
+++ b/mitmproxy/tools/console/palettes.py
@@ -225,10 +225,10 @@ class LowLight(Palette):
method_get = ('dark green', 'default'),
method_post = ('brown', 'default'),
method_head = ('dark cyan', 'default'),
- method_put = ('light red', 'default'),
+ method_put = ('light red', 'default'),
method_delete = ('dark red', 'default'),
method_other = ('light magenta', 'default'),
- method_http2_push = ('light gray','default'),
+ method_http2_push = ('light gray', 'default'),
scheme_http = ('dark cyan', 'default'),
scheme_https = ('light green', 'default'),
@@ -344,10 +344,10 @@ class SolarizedLight(LowLight):
method_get = (sol_green, 'default'),
method_post = (sol_orange, 'default'),
method_head = (sol_cyan, 'default'),
- method_put = (sol_red, 'default'),
+ method_put = (sol_red, 'default'),
method_delete = (sol_red, 'default'),
method_other = (sol_magenta, 'default'),
- method_http2_push = ('light gray','default'),
+ method_http2_push = ('light gray', 'default'),
scheme_http = (sol_cyan, 'default'),
scheme_https = ('light green', 'default'),
@@ -359,7 +359,7 @@ class SolarizedLight(LowLight):
url_extension = ('dark gray', 'default'),
url_query_key = (sol_blue, 'default'),
url_query_value = ('dark blue', 'default'),
-
+
focus = (sol_base01, 'default'),
code_200 = (sol_green, 'default'),