MCPcopy
hub / github.com/mitmproxy/mitmproxy / remove

Method remove

mitmproxy/tools/console/keymap.py:109–122  ·  view source on GitHub ↗

Remove a key from the key map.

(self, key: str, contexts: Sequence[str])

Source from the content-addressed store, hash-verified

107 self._on_change()
108
109 def remove(self, key: str, contexts: Sequence[str]) -> None:
110 """
111 Remove a key from the key map.
112 """
113 self._check_contexts(contexts)
114 for c in contexts:
115 b = self.get(c, key)
116 if b:
117 self.unbind(b)
118 b.contexts = [x for x in b.contexts if x != c]
119 if b.contexts:
120 self.bindings.append(b)
121 self.bind(b)
122 self._on_change()
123
124 def bind(self, binding: Binding) -> None:
125 for c in binding.contexts:

Callers 15

test_removeFunction · 0.95
addMethod · 0.95
key_unbindMethod · 0.45
key_unbind_focusMethod · 0.45
load_pathMethod · 0.45
deleteMethod · 0.45
giFunction · 0.45
measureTextSizeMethod · 0.45
aEFunction · 0.45
hEFunction · 0.45
destroyMethod · 0.45
drawMethod · 0.45

Calls 6

_check_contextsMethod · 0.95
getMethod · 0.95
unbindMethod · 0.95
bindMethod · 0.95
_on_changeMethod · 0.95
appendMethod · 0.45

Tested by 1

test_removeFunction · 0.76