Remove a key from the key map.
(self, key: str, contexts: Sequence[str])
| 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: |