mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-05-07 00:41:49 +08:00
Documentation and screenshots.
This commit is contained in:
@@ -318,7 +318,6 @@ class ConsoleMaster(flow.FlowMaster):
|
||||
('heading_key', "q"), ":back",
|
||||
]
|
||||
footer_text_flowview = [
|
||||
('heading_key', "tab"), ":toggle view ",
|
||||
('heading_key', "?"), ":help ",
|
||||
('heading_key', "q"), ":back ",
|
||||
]
|
||||
|
||||
@@ -84,6 +84,8 @@ def fcol(s, attr):
|
||||
|
||||
|
||||
|
||||
REPLAY_SYMBOL = u"\u21ba"
|
||||
|
||||
def format_flow(f, focus, extended=False, padding=2):
|
||||
pile = []
|
||||
|
||||
@@ -98,7 +100,7 @@ def format_flow(f, focus, extended=False, padding=2):
|
||||
else:
|
||||
req.append(fcol(">>" if focus else " ", "focus"))
|
||||
if f.request.is_replay():
|
||||
req.append(fcol(u"\u267B", "replay"))
|
||||
req.append(fcol(REPLAY_SYMBOL, "replay"))
|
||||
req.append(fcol(f.request.method, "method"))
|
||||
|
||||
preamble = sum(i[1] for i in req) + len(req) -1
|
||||
@@ -126,7 +128,7 @@ def format_flow(f, focus, extended=False, padding=2):
|
||||
|
||||
if f.response:
|
||||
if f.response.is_replay():
|
||||
resp.append(fcol(u"\u267B", "replay"))
|
||||
resp.append(fcol(REPLAY_SYMBOL, "replay"))
|
||||
if f.response.code in [200, 304]:
|
||||
resp.append(fcol(f.response.code, "goodcode"))
|
||||
else:
|
||||
|
||||
@@ -58,6 +58,10 @@ class ODict:
|
||||
return self.lst == other.lst
|
||||
|
||||
def __getitem__(self, k):
|
||||
"""
|
||||
Returns a list of values matching key.
|
||||
|
||||
"""
|
||||
ret = []
|
||||
k = self._kconv(k)
|
||||
for i in self.lst:
|
||||
@@ -73,18 +77,28 @@ class ODict:
|
||||
return new
|
||||
|
||||
def __len__(self):
|
||||
"""
|
||||
Total number of (key, value) pairs.
|
||||
"""
|
||||
return len(self.lst)
|
||||
|
||||
def __setitem__(self, k, values):
|
||||
if isinstance(values, basestring):
|
||||
raise ValueError("ODict values should be lists.")
|
||||
def __setitem__(self, k, valuelist):
|
||||
"""
|
||||
Sets the values for key k. If there are existing values for this
|
||||
key, they are cleared.
|
||||
"""
|
||||
if isinstance(valuelist, basestring):
|
||||
raise ValueError("ODict valuelist should be lists.")
|
||||
k = self._kconv(k)
|
||||
new = self._filter_lst(k, self.lst)
|
||||
for i in values:
|
||||
for i in valuelist:
|
||||
new.append((k, i))
|
||||
self.lst = new
|
||||
|
||||
def __delitem__(self, k):
|
||||
"""
|
||||
Delete all items matching k.
|
||||
"""
|
||||
self.lst = self._filter_lst(k, self.lst)
|
||||
|
||||
def __contains__(self, k):
|
||||
|
||||
Reference in New Issue
Block a user