(self, mapping, value)
| 513 | return web.notfound() |
| 514 | |
| 515 | def _match(self, mapping, value): |
| 516 | for pat, what in mapping: |
| 517 | if isinstance(what, application): |
| 518 | if value.startswith(pat): |
| 519 | f = lambda: self._delegate_sub_application(pat, what) |
| 520 | return f, None |
| 521 | else: |
| 522 | continue |
| 523 | elif isinstance(what, str): |
| 524 | what, result = utils.re_subm(rf"^{pat}\Z", what, value) |
| 525 | else: |
| 526 | result = utils.re_compile(rf"^{pat}\Z").match(value) |
| 527 | |
| 528 | if result: # it's a match |
| 529 | return what, [x for x in result.groups()] |
| 530 | return None, None |
| 531 | |
| 532 | def _delegate_sub_application(self, dir, app): |
| 533 | """Deletes request to sub application `app` rooted at the directory `dir`. |
no test coverage detected