MCPcopy
hub / github.com/mitmproxy/mitmproxy / Binding

Class Binding

mitmproxy/tools/console/keymap.py:51–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51class Binding:
52 def __init__(self, key, command, contexts, help):
53 self.key, self.command, self.contexts = key, command, sorted(contexts)
54 self.help = help
55
56 def keyspec(self):
57 """
58 Translate the key spec from a convenient user specification to one
59 Urwid understands.
60 """
61 return self.key.replace("space", " ")
62
63 def key_short(self) -> str:
64 return (
65 self.key.replace("enter", "⏎").replace("right", "→").replace("space", "␣")
66 )
67
68 def sortkey(self):
69 return self.key + ",".join(self.contexts)
70
71
72class Keymap:

Callers 1

addMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…