| 134 | |
| 135 | |
| 136 | class ConfiguredEdits(AbstractEdits): |
| 137 | def __init__( |
| 138 | self, |
| 139 | simple_edits, |
| 140 | cut_buffer_edits, |
| 141 | awaiting_config, |
| 142 | config, |
| 143 | key_dispatch, |
| 144 | ): |
| 145 | super().__init__(dict(simple_edits), dict(cut_buffer_edits)) |
| 146 | for attr, func in awaiting_config.items(): |
| 147 | for key in key_dispatch[getattr(config, attr)]: |
| 148 | super().add(key, func, overwrite=True) |
| 149 | |
| 150 | def add_config_attr(self, config_attr, func): |
| 151 | raise NotImplementedError("Config already set on this mapping") |
| 152 | |
| 153 | def add(self, key, func, overwrite=False): |
| 154 | raise NotImplementedError("Config already set on this mapping") |
| 155 | |
| 156 | |
| 157 | edit_keys = UnconfiguredEdits() |