| 484 | return Match.NONE, {} |
| 485 | |
| 486 | def url_path_for(self, name: str, /, **path_params: Any) -> URLPath: |
| 487 | if self.name is not None and name == self.name and "path" in path_params: |
| 488 | # 'name' matches "<mount_name>". |
| 489 | path = path_params.pop("path") |
| 490 | host, remaining_params = replace_params(self.host_format, self.param_convertors, path_params) |
| 491 | if not remaining_params: |
| 492 | return URLPath(path=path, host=host) |
| 493 | elif self.name is None or name.startswith(self.name + ":"): |
| 494 | if self.name is None: |
| 495 | # No mount name. |
| 496 | remaining_name = name |
| 497 | else: |
| 498 | # 'name' matches "<mount_name>:<child_name>". |
| 499 | remaining_name = name[len(self.name) + 1 :] |
| 500 | host, remaining_params = replace_params(self.host_format, self.param_convertors, path_params) |
| 501 | for route in self.routes or []: |
| 502 | try: |
| 503 | url = route.url_path_for(remaining_name, **remaining_params) |
| 504 | return URLPath(path=str(url), protocol=url.protocol, host=host) |
| 505 | except NoMatchFound: |
| 506 | pass |
| 507 | raise NoMatchFound(name, path_params) |
| 508 | |
| 509 | async def handle(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 510 | await self.app(scope, receive, send) |