MCPcopy Index your code
hub / github.com/webpy/webpy / add_processor

Method add_processor

web/application.py:132–149  ·  view source on GitHub ↗

Adds a processor to the application. >>> urls = ("/(.*)", "echo") >>> app = application(urls, globals()) >>> class echo: ... def GET(self, name): return name ... >>> >>> def hello(handler): return "hell

(self, processor)

Source from the content-addressed store, hash-verified

130 self.mapping.append((pattern, classname))
131
132 def add_processor(self, processor):
133 """
134 Adds a processor to the application.
135
136 >>> urls = ("/(.*)", "echo")
137 >>> app = application(urls, globals())
138 >>> class echo:
139 ... def GET(self, name): return name
140 ...
141 >>>
142 >>> def hello(handler): return "hello, " + handler()
143 ...
144 >>> app.add_processor(hello)
145 >>> app.request("/web.py").data
146 'hello, web.py'
147 """
148 # PY3DOCTEST: b'hello, web.py'
149 self.processors.append(processor)
150
151 def request(
152 self,

Callers 5

__init__Method · 0.95
test_subdirsMethod · 0.80
test_processorsMethod · 0.80
testUnloadMethod · 0.80
__init__Method · 0.80

Calls 1

appendMethod · 0.80

Tested by 3

test_subdirsMethod · 0.64
test_processorsMethod · 0.64
testUnloadMethod · 0.64