aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/common.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-03-13 22:29:21 +1100
committerAldo Cortesi <aldo@nullcube.com>2015-03-13 22:29:21 +1100
commit87a3c710415878968f2333e1d7bc4adeccc3a9cb (patch)
treed0a098578bad928bf25e24fd55f830b0501feed5 /libmproxy/console/common.py
parent468cc81c8a86bf6f304dfebb5858fa15d27c155b (diff)
downloadmitmproxy-87a3c710415878968f2333e1d7bc4adeccc3a9cb.tar.gz
mitmproxy-87a3c710415878968f2333e1d7bc4adeccc3a9cb.tar.bz2
mitmproxy-87a3c710415878968f2333e1d7bc4adeccc3a9cb.zip
Formatting and whitespace
Diffstat (limited to 'libmproxy/console/common.py')
-rw-r--r--libmproxy/console/common.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py
index fa21c93e..c0da9bb3 100644
--- a/libmproxy/console/common.py
+++ b/libmproxy/console/common.py
@@ -41,6 +41,8 @@ def highlight_key(s, k):
KEY_MAX = 30
+
+
def format_keyvals(lst, key="key", val="text", indent=0):
"""
Format a list of (key, value) tuples.
@@ -103,10 +105,8 @@ else:
SYMBOL_RETURN = u"<-"
-
def raw_format_flow(f, focus, extended, padding):
f = dict(f)
-
pile = []
req = []
if extended:
@@ -122,7 +122,7 @@ def raw_format_flow(f, focus, extended, padding):
req.append(fcol(SYMBOL_REPLAY, "replay"))
req.append(fcol(f["req_method"], "method"))
- preamble = sum(i[1] for i in req) + len(req) -1
+ preamble = sum(i[1] for i in req) + len(req) - 1
if f["intercepted"] and not f["acked"]:
uc = "intercept"
@@ -348,7 +348,6 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2):
duration = 0
if f.response.timestamp_end and f.request.timestamp_start:
duration = f.response.timestamp_end - f.request.timestamp_start
- size = f.response.size()
roundtrip = utils.pretty_duration(duration)
d.update(dict(
@@ -362,7 +361,9 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2):
d["resp_ctype"] = t[0].split(";")[0]
else:
d["resp_ctype"] = ""
- return flowcache.format_flow(tuple(sorted(d.items())), focus, extended, padding)
+ return flowcache.format_flow(
+ tuple(sorted(d.items())), focus, extended, padding
+ )
def int_version(v):
@@ -380,8 +381,8 @@ class WWrap(urwid.WidgetWrap):
if int_version(urwid.__version__) >= 990:
def set_w(self, x):
self._w = x
+
def get_w(self):
return self._w
- w = property(get_w, set_w)
-
+ w = property(get_w, set_w)