1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
Metadata-Version: 1.2
Name: plaster_pastedeploy
Version: 0.5
Summary: A loader implementing the PasteDeploy syntax to be used by plaster.
Home-page: https://github.com/Pylons/plaster_pastedeploy
Author: Hunter Senft-Grupp
Author-email: pylons-discuss@googlegroups.com
License: UNKNOWN
Description: ===================
plaster_pastedeploy
===================
.. image:: https://img.shields.io/pypi/v/plaster_pastedeploy.svg
:target: https://pypi.python.org/pypi/plaster_pastedeploy
.. image:: https://img.shields.io/travis/Pylons/plaster_pastedeploy/master.svg
:target: https://travis-ci.org/Pylons/plaster_pastedeploy
``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``.
.. code-block:: python
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``
- ``pastedeploy+ini:///path/to/development.ini``
- ``pastedeploy+ini://development.ini#foo``
- ``egg:MyApp?debug=false#foo``
.. _PasteDeploy: https://pastedeploy.readthedocs.io/en/latest/
.. _plaster: https://docs.pylonsproject.org/projects/plaster/en/latest/
0.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.
See https://github.com/Pylons/plaster_pastedeploy/pull/15
0.4.2 (2017-11-20)
==================
- Fix ``ConfigDict.copy`` so that it works.
See https://github.com/Pylons/plaster_pastedeploy/pull/14
0.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.
See https://github.com/Pylons/plaster_pastedeploy/pull/10
- Escape environment variables such that their contents are not subject to
interpolation. See https://github.com/Pylons/plaster_pastedeploy/pull/10
- Invoke ``logging.basicConfig`` when ``setup_logging`` is called and the
config file doesn't contain any logging setup or the URI is using the
``egg:`` protocol. See https://github.com/Pylons/plaster_pastedeploy/pull/11
0.4 (2017-07-09)
================
- Fix ``get_settings`` for 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 for ``set default_foo = bar`` and ``get foo = default_foo``
syntax to override a default value and to pull a default value into the
settings, respectively. In the above example the value ``foo = bar`` would
be returned. Any other defaults not pulled into the section via either
interpolation or the ``get`` syntax will be ignored.
See https://github.com/Pylons/plaster_pastedeploy/pull/6
- Inject environment variables into the defaults automatically. These will
be available for interpolation as ``ENV_<foo>``. For example if environment
variable ``APP_DEBUG=true`` then ``%(ENV_APP_DEBUG)s`` will work within the
ini file. See https://github.com/Pylons/plaster_pastedeploy/pull/7
- ``get_settings`` and ``get_wsgi_app_settings`` both return only the local
config now. However, the returned object has a ``global_conf`` attribute
containing the defaults as well as a ``loader`` attribute pointing at
the loader instance.
See https://github.com/Pylons/plaster_pastedeploy/pull/8
0.3.2 (2017-07-01)
==================
- Resolve an issue in which ``NoSectionError`` would not be properly caught on
Python 2.7 if the ``configparser`` module was installed from PyPI.
See https://github.com/Pylons/plaster_pastedeploy/issues/5
0.3.1 (2017-06-02)
==================
- Recognize the ``pastedeploy+egg`` scheme as an ``egg`` type.
0.3 (2017-06-02)
================
- Drop the ``ini`` scheme and replace with ``file+ini`` and ``pastedeploy``.
Also rename ``ini+pastedeploy`` and ``egg+pastedeploy`` to
``pastedeploy+ini`` and ``pastedeploy+egg`` respectively.
See https://github.com/Pylons/plaster_pastedeploy/pull/4
0.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 raise ``plaster.NoSectionError`` exceptions. Empty dictionaries
are returned for missing sections and a user should check ``get_sections``
for the list of valid sections.
0.1 (2017-03-27)
================
- Initial release.
Keywords: plaster pastedeploy plaster_pastedeploy ini config egg
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
|