(self, scope: Scope)
| 236 | self.path_regex, self.path_format, self.param_convertors = compile_path(path) |
| 237 | |
| 238 | def matches(self, scope: Scope) -> tuple[Match, Scope]: |
| 239 | path_params: dict[str, Any] |
| 240 | if scope["type"] == "http": |
| 241 | route_path = get_route_path(scope) |
| 242 | match = self.path_regex.match(route_path) |
| 243 | if match: |
| 244 | matched_params = match.groupdict() |
| 245 | for key, value in matched_params.items(): |
| 246 | matched_params[key] = self.param_convertors[key].convert(value) |
| 247 | path_params = dict(scope.get("path_params", {})) |
| 248 | path_params.update(matched_params) |
| 249 | child_scope = {"endpoint": self.endpoint, "path_params": path_params} |
| 250 | if self.methods and scope["method"] not in self.methods: |
| 251 | return Match.PARTIAL, child_scope |
| 252 | else: |
| 253 | return Match.FULL, child_scope |
| 254 | return Match.NONE, {} |
| 255 | |
| 256 | def url_path_for(self, name: str, /, **path_params: Any) -> URLPath: |
| 257 | seen_params = set(path_params.keys()) |
nothing calls this directly
no test coverage detected