l.s.w.initialization : module documentation

Part of lp.services.webapp

Initializes the application after ZCML has been processed.
Function adapter_mask Undocumented
Function handle_process_start Post-process ZCML configuration.
Function fix_up_namespace_traversers Block namespace traversers from being found as normal views.
Function customize_get_converter URL parameter conversion errors shouldn't generate an OOPS report.
@implementer(Interface)
def adapter_mask(*args):
Undocumented
@adapter(IDatabaseOpened)
def handle_process_start(ev):
Post-process ZCML configuration.

Normal configuration should happen in ZCML (or whatever our Zope configuration standard might become in the future). The only kind of configuration that should happen here is automated fix-up configuration. Code below should call functions, each of which explains why it cannot be performed in ZCML.

Also see the lp_sitecustomize module for initialization that is done when Python first starts.

def fix_up_namespace_traversers():
Block namespace traversers from being found as normal views.

See bug 589010.

This is done in a function rather than in ZCML because automation is appropriate: there has already been an explicit registration of the namespace, and having to also say "please don't assume it is a view" is a DRY violation that we can avoid.

def customize_get_converter(zope_publisher_browser=zope.publisher.browser):
URL parameter conversion errors shouldn't generate an OOPS report.

This injects (monkey patches) our wrapper around get_converter so improper use of parameter type converters (like http://...?foo=bar:int) won't generate OOPS reports.

This is done in a function rather than in ZCML because zope.publisher doesn't provide fine enough control of this any other way.

API Documentation for Launchpad, generated by pydoctor at 2018-11-18 00:00:05.