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

Function loadhook

web/application.py:666–680  ·  view source on GitHub ↗

Converts a load hook into an application processor. >>> app = auto_application() >>> def f(): "something done before handling request" ... >>> app.add_processor(loadhook(f))

(h)

Source from the content-addressed store, hash-verified

664
665
666def loadhook(h):
667 """
668 Converts a load hook into an application processor.
669
670 >>> app = auto_application()
671 >>> def f(): "something done before handling request"
672 ...
673 >>> app.add_processor(loadhook(f))
674 """
675
676 def processor(handler):
677 h()
678 return handler()
679
680 return processor
681
682
683def unloadhook(h):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected