MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / prettify

Method prettify

mitmproxy/contentviews/_compat.py:47–58  ·  view source on GitHub ↗
(self, data: bytes, metadata: Metadata)

Source from the content-addressed store, hash-verified

45 )
46
47 def prettify(self, data: bytes, metadata: Metadata) -> str:
48 lines: Iterator[TViewLine]
49 desc_, lines = self.contentview(
50 data,
51 content_type=metadata.content_type,
52 flow=metadata.flow,
53 http_message=metadata.http_message,
54 )
55 return "\n".join(
56 "".join(always_str(text, "utf8", "backslashescape") for tag, text in line)
57 for line in lines
58 )
59
60 def __init__(self, contentview: View):
61 self.contentview = contentview

Callers 1

test_legacy_contentviewFunction · 0.95

Calls 2

always_strFunction · 0.90
joinMethod · 0.45

Tested by 1

test_legacy_contentviewFunction · 0.76