diff options
| author | Chris McDonough <chrism@plope.com> | 2012-11-20 22:21:27 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-11-20 22:21:27 -0500 |
| commit | 427a355af9cfb0e90f4a72a5e89b821ddbd76c1a (patch) | |
| tree | 162d4b649e7b3b98e8653e51728fdab0000e8014 | |
| parent | c495e90e8d197ff5d9242bd2368d7579d993bd51 (diff) | |
| parent | e96817beccacd6e9cc7f6e0f13698ab891226dbc (diff) | |
| download | pyramid-427a355af9cfb0e90f4a72a5e89b821ddbd76c1a.tar.gz pyramid-427a355af9cfb0e90f4a72a5e89b821ddbd76c1a.tar.bz2 pyramid-427a355af9cfb0e90f4a72a5e89b821ddbd76c1a.zip | |
Merge branch 'fix_commands' of git://github.com/sontek/pyramid into sontek-fix_commands
| -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 |
