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

Method add

src/werkzeug/routing/map.py:170–181  ·  view source on GitHub ↗

Add a new rule or factory to the map and bind it. Requires that the rule is not bound to another map. :param rulefactory: a :class:`Rule` or :class:`RuleFactory`

(self, rulefactory: RuleFactory)

Source from the content-addressed store, hash-verified

168 return iter(self._rules)
169
170 def add(self, rulefactory: RuleFactory) -> None:
171 """Add a new rule or factory to the map and bind it. Requires that the
172 rule is not bound to another map.
173
174 :param rulefactory: a :class:`Rule` or :class:`RuleFactory`
175 """
176 for rule in rulefactory.get_rules(self):
177 rule.bind(self)
178 if not rule.build_only:
179 self._matcher.add(rule)
180 self._rules_by_endpoint.setdefault(rule.endpoint, []).append(rule)
181 self._remap = True
182
183 def bind(
184 self,

Callers 15

__init__Method · 0.95
openMethod · 0.45
_reloader.pyFile · 0.45
_find_stat_pathsFunction · 0.45
_find_watchdog_pathsFunction · 0.45
_walkFunction · 0.45
writeMethod · 0.45
set_cookieMethod · 0.45
www_authenticateMethod · 0.45
__init__Method · 0.45
_parse_ruleMethod · 0.45
test_set_headerMethod · 0.45

Calls 4

appendMethod · 0.80
get_rulesMethod · 0.45
bindMethod · 0.45
setdefaultMethod · 0.45

Tested by 13

openMethod · 0.36
test_set_headerMethod · 0.36
test_basic_interfaceMethod · 0.36
test_dict_is_hashableMethod · 0.36
test_basic_interfaceMethod · 0.36
test_copyingMethod · 0.36
test_reject_newlinesMethod · 0.36
test_equalityMethod · 0.36
test_basic_interfaceMethod · 0.36