MCPcopy Create free account
hub / github.com/EasyIME/PIME / add_handlers

Method add_handlers

python/python3/tornado/web.py:2144–2158  ·  view source on GitHub ↗

Appends the given handlers to our handler list. Host patterns are processed sequentially in the order they were added. All matching patterns will be considered.

(self, host_pattern: str, host_handlers: _RuleList)

Source from the content-addressed store, hash-verified

2142 return server
2143
2144 def add_handlers(self, host_pattern: str, host_handlers: _RuleList) -> None:
2145 """Appends the given handlers to our handler list.
2146
2147 Host patterns are processed sequentially in the order they were
2148 added. All matching patterns will be considered.
2149 """
2150 host_matcher = HostMatches(host_pattern)
2151 rule = Rule(host_matcher, _ApplicationRouter(self, host_handlers))
2152
2153 self.default_router.rules.insert(-1, rule)
2154
2155 if self.default_host is not None:
2156 self.wildcard_router.add_rules(
2157 [(DefaultHostMatches(self, host_matcher.host_pattern), host_handlers)]
2158 )
2159
2160 def add_transform(self, transform_class: Type["OutputTransform"]) -> None:
2161 self.transforms.append(transform_class)

Callers 3

get_appMethod · 0.95
test_host_matchingMethod · 0.80

Calls 5

HostMatchesClass · 0.90
RuleClass · 0.90
DefaultHostMatchesClass · 0.90
_ApplicationRouterClass · 0.85
add_rulesMethod · 0.80

Tested by 3

get_appMethod · 0.76
test_host_matchingMethod · 0.64