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

Method __init__

src/werkzeug/routing/map.py:94–124  ·  view source on GitHub ↗
(
        self,
        rules: t.Iterable[RuleFactory] | None = None,
        default_subdomain: str = "",
        strict_slashes: bool = True,
        merge_slashes: bool = True,
        redirect_defaults: bool = True,
        converters: t.Mapping[str, type[BaseConverter]] | None = None,
        sort_parameters: bool = False,
        sort_key: t.Callable[[t.Any], t.Any] | None = None,
        host_matching: bool = False,
    )

Source from the content-addressed store, hash-verified

92 lock_class = Lock
93
94 def __init__(
95 self,
96 rules: t.Iterable[RuleFactory] | None = None,
97 default_subdomain: str = "",
98 strict_slashes: bool = True,
99 merge_slashes: bool = True,
100 redirect_defaults: bool = True,
101 converters: t.Mapping[str, type[BaseConverter]] | None = None,
102 sort_parameters: bool = False,
103 sort_key: t.Callable[[t.Any], t.Any] | None = None,
104 host_matching: bool = False,
105 ) -> None:
106 self._matcher = StateMachineMatcher(merge_slashes)
107 self._rules_by_endpoint: dict[t.Any, list[Rule]] = {}
108 self._remap = True
109 self._remap_lock = self.lock_class()
110
111 self.default_subdomain = default_subdomain
112 self.strict_slashes = strict_slashes
113 self.redirect_defaults = redirect_defaults
114 self.host_matching = host_matching
115
116 self.converters = self.default_converters.copy()
117 if converters:
118 self.converters.update(converters)
119
120 self.sort_parameters = sort_parameters
121 self.sort_key = sort_key
122
123 for rulefactory in rules or ():
124 self.add(rulefactory)
125
126 @property
127 def merge_slashes(self) -> bool:

Callers

nothing calls this directly

Calls 4

addMethod · 0.95
StateMachineMatcherClass · 0.85
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected