| 497 | return Match.NONE, {} |
| 498 | |
| 499 | def url_path_for(self, name: str, /, **path_params: Any) -> URLPath: |
| 500 | if self.name is not None and name == self.name and "path" in path_params: |
| 501 | # 'name' matches "<mount_name>". |
| 502 | path = path_params.pop("path") |
| 503 | host, remaining_params = replace_params(self.host_format, self.param_convertors, path_params) |
| 504 | if not remaining_params: |
| 505 | return URLPath(path=path, host=host) |
| 506 | elif self.name is None or name.startswith(self.name + ":"): |
| 507 | if self.name is None: |
| 508 | # No mount name. |
| 509 | remaining_name = name |
| 510 | else: |
| 511 | # 'name' matches "<mount_name>:<child_name>". |
| 512 | remaining_name = name[len(self.name) + 1 :] |
| 513 | host, remaining_params = replace_params(self.host_format, self.param_convertors, path_params) |
| 514 | for route in self.routes or []: |
| 515 | try: |
| 516 | url = route.url_path_for(remaining_name, **remaining_params) |
| 517 | return URLPath(path=str(url), protocol=url.protocol, host=host) |
| 518 | except NoMatchFound: |
| 519 | pass |
| 520 | raise NoMatchFound(name, path_params) |
| 521 | |
| 522 | async def handle(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 523 | await self.app(scope, receive, send) |