pyramid_zcml API¶
-
pyramid_zcml.load_zcml(spec='configure.zcml', features=())¶ Load configuration from a ZCML file into the current configuration state. The
specargument is an absolute filename, a relative filename, or a asset specification, defaulting toconfigure.zcml(relative to the package of the method’s caller).The
featuresargument can be any iterable of strings. These are useful for conditionally including or excluding parts of a ZCML file.
-
pyramid_zcml.make_app(root_factory, package=None, filename='configure.zcml', settings=None)¶ Return a Router object, representing a fully configured Pyramid WSGI application.
Warning
Use of this function is deprecated as of Pyramid 1.0. You should instead use a
pyramid.config.Configuratorinstance to perform startup configuration as shown in Application Configuration.root_factorymust be a callable that accepts a request object and which returns a traversal root object. The traversal root returned by the root factory is the default traversal root; it can be overridden on a per-view basis.root_factorymay beNone, in which case a ‘default default’ traversal root is used.packageis a Python package or module representing the application’s package. It is optional, defaulting toNone.packagemay beNone. IfpackageisNone, thefilenamepassed or the value in theoptionsdictionary namedconfigure_zcmlmust be a) absolute pathname to a ZCML file that represents the application’s configuration or b) a asset specification to a ZCML file in the formdotted.package.name:relative/file/path.zcml.filenameis the filesystem path to a ZCML file (optionally relative to the package path) that should be parsed to create the application registry. It defaults toconfigure.zcml. It can also be a ;term:asset specification in the formdotted_package_name:relative/file/path.zcml. Note that if any value forconfigure_zcmlis passed within thesettingsdictionary, the value passed asfilenamewill be ignored, replaced with theconfigure_zcmlvalue.settings, if used, should be a dictionary containing runtime settings (e.g. the key/value pairs in an app section of a PasteDeploy file), with each key representing the option and the key’s value representing the specific option value, e.g.{'reload_templates':True}. Note that the keyword parameteroptionsis a backwards compatibility alias for thesettingskeyword parameter.
-
pyramid_zcml.includeme(config)¶ Function meant to be included via
pyramid.config.Configurator.include(), which sets up the Configurator with aload_zcmlmethod.