diff options
| author | John Anderson <sontek@gmail.com> | 2012-11-14 11:32:17 -0300 |
|---|---|---|
| committer | John Anderson <sontek@gmail.com> | 2012-11-14 11:32:17 -0300 |
| commit | e96817beccacd6e9cc7f6e0f13698ab891226dbc (patch) | |
| tree | be0a9ba8237d843861374d9f3f2f2c76320453ca | |
| parent | 49fb779f52748df05c911263d1305cda3e86a5ec (diff) | |
| download | pyramid-e96817beccacd6e9cc7f6e0f13698ab891226dbc.tar.gz pyramid-e96817beccacd6e9cc7f6e0f13698ab891226dbc.tar.bz2 pyramid-e96817beccacd6e9cc7f6e0f13698ab891226dbc.zip | |
Don't use a global mutable and updated the doc string to include options
| -rw-r--r-- | pyramid/paster.py | 8 | ||||
| -rw-r--r-- | pyramid/tests/test_scripts/test_prequest.py | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pyramid/paster.py b/pyramid/paster.py index b1a6d4c8b..6dd7f9086 100644 --- a/pyramid/paster.py +++ b/pyramid/paster.py @@ -9,7 +9,7 @@ from pyramid.compat import configparser from logging.config import fileConfig from pyramid.scripting import prepare -def get_app(config_uri, name=None, options={}, loadapp=loadapp): +def get_app(config_uri, name=None, options=None, loadapp=loadapp): """ Return the WSGI application named ``name`` in the PasteDeploy config file specified by ``config_uri``. @@ -72,7 +72,7 @@ def _getpathsec(config_uri, name): section = name return path, section -def bootstrap(config_uri, request=None, options={}): +def bootstrap(config_uri, request=None, options=None): """ Load a WSGI application from the PasteDeploy config file specified by ``config_uri``. The environment will be configured as if it is currently serving ``request``, leaving a natural environment in place @@ -112,6 +112,10 @@ def bootstrap(config_uri, request=None, options={}): for you if none is provided. You can mutate the request's ``environ`` later to setup a specific host/port/scheme/etc. + ``options`` Is passed to get_app for use as variable assignments like + {'http_port': 8080} and then use %(http_port)s in the + config file. + See :ref:`writing_a_script` for more information about how to use this function. """ diff --git a/pyramid/tests/test_scripts/test_prequest.py b/pyramid/tests/test_scripts/test_prequest.py index 76cb35881..91d2b322a 100644 --- a/pyramid/tests/test_scripts/test_prequest.py +++ b/pyramid/tests/test_scripts/test_prequest.py @@ -13,10 +13,10 @@ class TestPRequestCommand(unittest.TestCase): cmd.out = self.out return cmd - def get_app(self, spec, app_name=None, options={}): + def get_app(self, spec, app_name=None, options=None): self._spec = spec self._app_name = app_name - self._options = options + self._options = options or {} def helloworld(environ, start_request): self._environ = environ |
