Called before matching and building to keep the compiled rules in the correct order after things changed.
(self)
| 359 | ) |
| 360 | |
| 361 | def update(self) -> None: |
| 362 | """Called before matching and building to keep the compiled rules |
| 363 | in the correct order after things changed. |
| 364 | """ |
| 365 | if not self._remap: |
| 366 | return |
| 367 | |
| 368 | with self._remap_lock: |
| 369 | if not self._remap: |
| 370 | return |
| 371 | |
| 372 | self._matcher.update() |
| 373 | for rules in self._rules_by_endpoint.values(): |
| 374 | rules.sort(key=lambda x: x.build_compare_key()) |
| 375 | self._remap = False |
| 376 | |
| 377 | def __repr__(self) -> str: |
| 378 | rules = self.iter_rules() |