MCPcopy
hub / github.com/pallets/werkzeug / get_converter

Method get_converter

src/werkzeug/routing/rules.py:582–595  ·  view source on GitHub ↗

Looks up the converter for the given parameter. .. versionadded:: 0.9

(
        self,
        variable_name: str,
        converter_name: str,
        args: tuple[t.Any, ...],
        kwargs: t.Mapping[str, t.Any],
    )

Source from the content-addressed store, hash-verified

580 self.compile()
581
582 def get_converter(
583 self,
584 variable_name: str,
585 converter_name: str,
586 args: tuple[t.Any, ...],
587 kwargs: t.Mapping[str, t.Any],
588 ) -> BaseConverter:
589 """Looks up the converter for the given parameter.
590
591 .. versionadded:: 0.9
592 """
593 if converter_name not in self.map.converters:
594 raise LookupError(f"the converter {converter_name!r} does not exist")
595 return self.map.converters[converter_name](self.map, *args, **kwargs)
596
597 def _encode_query_vars(self, query_vars: t.Mapping[str, t.Any]) -> str:
598 items: t.Iterable[tuple[str, str]] = iter_multi_items(query_vars)

Callers 1

_parse_ruleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected