Skip to main content

A loader implementing the PasteDeploy syntax to be used by plaster.

Project description

https://img.shields.io/pypi/v/plaster_pastedeploy.svg https://img.shields.io/travis/Pylons/plaster_pastedeploy.svg

plaster_pastedeploy is a plaster plugin that provides a plaster.Loader that can parse ini files according to the standard set by PasteDeploy. It supports the wsgi plaster protocol, implementing the plaster.protocols.IWSGIProtocol interface.

Usage

Applications should use plaster_pastedeploy to load settings from named sections in a configuration source (usually a file).

  • Please look at the documentation for plaster on how to integrate this loader into your application.

  • Please look at the documentation for PasteDeploy on the specifics of the supported INI file format.

Most applications will want to use plaster.get_loader(uri, protocols=['wsgi']) to get this loader. It then exposes get_wsgi_app, get_wsgi_app_settings, get_wsgi_filter and get_wsgi_server.

import plaster

loader = plaster.get_loader('development.ini', protocols=['wsgi'])
# to get any section out of the config file
settings = loader.get_settings('app:main')

# to get settings for a WSGI app
app_config = loader.get_wsgi_app_settings() # defaults to main

# to get an actual WSGI app
app = loader.get_wsgi_app() # defaults to main

# to get a filter and compose it with an app
filter = loader.get_wsgi_filter('filt')
app = filter(app)

# to get a WSGI server
server = loader.get_wsgi_server() # defaults to main

# to start the WSGI server
server(app)

Any plaster.PlasterURL options are forwarded as defaults to the loader. Some examples are below:

  • development.ini#myapp

  • development.ini?http_port=8080#main

  • ini+pastedeploy:///path/to/development.ini

  • ini+pastedeploy://development.ini#foo

  • egg:MyApp?debug=false#foo

0.1 (2017-03-27)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plaster_pastedeploy-0.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plaster_pastedeploy-0.1-py2.py3-none-any.whl (7.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file plaster_pastedeploy-0.1.tar.gz.

File metadata

File hashes

Hashes for plaster_pastedeploy-0.1.tar.gz
Algorithm Hash digest
SHA256 773f72282f7085850c846d97331983f54fd70e66997f3f59252fb3e4af7f6cb8
MD5 275bdca3b2ce92d16cfd51ff3e0a410a
BLAKE2b-256 5d84bed53fff7e3deb1ce9e562712e709cafb7bcb3c6bcba1e32a6d68e94de38

See more details on using hashes here.

File details

Details for the file plaster_pastedeploy-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for plaster_pastedeploy-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 35d05ec035f59db5dac916fe30a3a1c25d6d52cb3be4233e97b78b9469274434
MD5 fef74d572decb9d025a37bde62e1d285
BLAKE2b-256 6707802a8cfa4a7ff86f49e146c5022a3c2568cc5d16ae71d196db2ec6b2ea77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page