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)
| 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, |