Package: plaster-pastedeploy
plaster_pastedeployis aplasterplugin that provides aplaster.Loaderthat can parse ini files according to the standard set byPasteDeploy. It
supports thewsgiplaster protocol, implementing theplaster.protocols.IWSGIProtocolinterface.UsageApplications should useplaster_pastedeployto load settings from named
sections in a configuration source (usually a file).Please look at the documentation forplasteron how to integrate this
loader into your application.Please look at the documentation forPasteDeployon the specifics of the
supported INI file format.Most applications will want to useplaster.get_loader(uri,protocols=['wsgi'])to get this loader. It then
exposesget_wsgi_app,get_wsgi_app_settings,get_wsgi_filterandget_wsgi_server.importplasterloader=plaster.get_loader('development.ini',protocols=['wsgi'])# to get any section out of the config filesettings=loader.get_settings('app:main')# to get settings for a WSGI appapp_config=loader.get_wsgi_app_settings()# defaults to main# to get an actual WSGI appapp=loader.get_wsgi_app()# defaults to main# to get a filter and compose it with an appfilter=loader.get_wsgi_filter('filt')app=filter(app)# to get a WSGI serverserver=loader.get_wsgi_server()# defaults to main# to start the WSGI serverserver(app)Anyplaster.PlasterURLoptions are forwarded as defaults to the loader.
Some examples are below:development.ini#myappdevelopment.ini?http_port=8080#mainpastedeploy+ini:///path/to/development.inipastedeploy+ini://development.ini#fooegg:MyApp?debug=false#foo1.0.1 (2022-11-06)Minor release to cleanup README.1.0 (2022-11-06)Drop support for Python 2.7, 3.4, 3.5, 3.6.Add support for Python 3.8, 3.9, 3.10.Blackify the codebase.Switch CI to Github Actions.0.7 (2019-04-12)Support Python 3.7.Depend onpastedeploy >= 2.0to enforce new behavior when overriding
defaults. Default values passed into the loader will now override values in
the[DEFAULT]section.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/170.6 (2018-07-11)Changesetup_loggingto invokelogging.config.fileConfigwithdisable_existing_loggers=Falseto avoid disabling any loggers that were
imported prior to configuration of the logging system.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/160.5 (2018-03-29)Removed environment variable support entirely for now. The feature requires
bugfixes upstream in PasteDeploy which have not been done yet and this was
breaking people’s environments so it is gone for now.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/150.4.2 (2017-11-20)FixConfigDict.copyso that it works.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/140.4.1 (2017-07-10)Disable environment variable support on Python 2. PasteDeploy does not
support escaping the contents on Python 2 which means any variable with
a value of the format %(foo)s would break the parser. Because this is
implicit behavior it was deemed too error prone to support.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/10Escape environment variables such that their contents are not subject to
interpolation. Seehttps://github.com/Pylons/plaster_pastedeploy/pull/10Invokelogging.basicConfigwhensetup_loggingis called and the
config file doesn’t contain any logging setup or the URI is using theegg:protocol. Seehttps://github.com/Pylons/plaster_pastedeploy/pull/110.4 (2017-07-09)Fixget_settingsfor an arbitrary section to follow the same rules as
PasteDeploy with regards to the handling of defaults. The goal of this
package is to be compliant with PasteDeploy’s format for all sections in
the file such that there are no surprising format changes in various
sections.Supported added forset default_foo = barandget foo = default_foosyntax to override a default value and to pull a default value into the
settings, respectively. In the above example the valuefoo = barwould
be returned. Any other defaults not pulled into the section via either
interpolation or thegetsyntax will be ignored.Seehttps://github.com/Pylons/plaster_pastedeploy/pull/6Inject environment variables into the defaults automatically. These will
be available for interpolation asENV_<foo>. For example if environment
variableAPP_DEBUG=truethen%(ENV_APP_DEBUG)swill work within the
ini file. Seehttps://github.com/Pylons/plaster_pastedeploy/pull/7get_settingsandget_wsgi_app_settingsboth return only the local
config now. However, the returned object has aglobal_confattribute
containing the defaults as well as aloaderattribute pointing at
the loader instance.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/80.3.2 (2017-07-01)Resolve an issue in whichNoSectionErrorwould not be properly caught on
Python 2.7 if theconfigparsermodule was installed from PyPI.
Seehttps://github.com/Pylons/plaster_pastedeploy/issues/50.3.1 (2017-06-02)Recognize thepastedeploy+eggscheme as aneggtype.0.3 (2017-06-02)Drop theinischeme and replace withfile+iniandpastedeploy.
Also renameini+pastedeployandegg+pastedeploytopastedeploy+iniandpastedeploy+eggrespectively.
Seehttps://github.com/Pylons/plaster_pastedeploy/pull/40.2.1 (2017-03-29)Fix a bug in 0.2 in which an exception was raised for an invalid section
if the a non-config-file-based protocol was used.0.2 (2017-03-29)No longer raiseplaster.NoSectionErrorexceptions. Empty dictionaries
are returned for missing sections and a user should checkget_sectionsfor the list of valid sections.0.1 (2017-03-27)Initial release.