diff options
| -rw-r--r-- | CHANGES.txt | 6 | ||||
| -rw-r--r-- | TODO.txt | 2 | ||||
| -rw-r--r-- | docs/api/settings.rst | 2 | ||||
| -rw-r--r-- | pyramid/settings.py | 26 | ||||
| -rw-r--r-- | pyramid/tests/test_settings.py | 26 |
5 files changed, 6 insertions, 56 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 7e0bf73cf..cffccca06 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -192,6 +192,12 @@ Backwards Incompatibilities depended on this, adjust your code to import ``pyramid.scaffolds.PyramidTemplate`` instead. +- The ``pyramid.settings.get_settings()`` API was removed. It had been + printing a deprecation warning since Pyramid 1.0. If your code depended on + this API, use ``pyramid.threadlocal.get_current_registry().settings`` + instead or use the ``settings`` attribute of the registry available from + the request (``request.registry.settings``). + Dependencies ------------ @@ -98,8 +98,6 @@ Nice-to-Have Future ------ -- 1.4: Remove ``pyramid.paster.PyramidTemplate`` (deprecated). - - 1.4: Remove ``pyramid.settings.get_settings`` (deprecated). - 1.5: Remove all deprecated ``pyramid.testing`` functions. diff --git a/docs/api/settings.rst b/docs/api/settings.rst index 6b12c038c..cd802e138 100644 --- a/docs/api/settings.rst +++ b/docs/api/settings.rst @@ -5,8 +5,6 @@ .. automodule:: pyramid.settings - .. autofunction:: get_settings - .. autofunction:: asbool .. autofunction:: aslist diff --git a/pyramid/settings.py b/pyramid/settings.py index 86304307e..e2cb3cb3c 100644 --- a/pyramid/settings.py +++ b/pyramid/settings.py @@ -1,31 +1,5 @@ -from zope.deprecation import deprecated - -from pyramid.threadlocal import get_current_registry from pyramid.compat import string_types -def get_settings(): - """ - Return a :term:`deployment settings` object for the current application. - The object is a dictionary-like object that contains key/value pairs - based on the dictionary passed as the ``settings`` argument to the - :class:`pyramid.config.Configurator` constructor or the - :func:`pyramid.router.make_app` API. - - .. warning:: This method is deprecated as of Pyramid 1.0. Use - ``pyramid.threadlocal.get_current_registry().settings`` instead or use - the ``settings`` attribute of the registry available from the request - (``request.registry.settings``). - """ - reg = get_current_registry() - return reg.settings - -deprecated( - 'get_settings', - '(pyramid.settings.get_settings is deprecated as of Pyramid 1.0. Use' - '``pyramid.threadlocal.get_current_registry().settings`` instead or use ' - 'the ``settings`` attribute of the registry available from the request ' - '(``request.registry.settings``)).') - truthy = frozenset(('t', 'true', 'y', 'yes', 'on', '1')) def asbool(s): diff --git a/pyramid/tests/test_settings.py b/pyramid/tests/test_settings.py index 2ef15f62a..a586cb6fd 100644 --- a/pyramid/tests/test_settings.py +++ b/pyramid/tests/test_settings.py @@ -1,30 +1,4 @@ import unittest -from pyramid import testing - -class TestGetSettings(unittest.TestCase): - def setUp(self): - from pyramid.registry import Registry - registry = Registry('testing') - self.config = testing.setUp(registry=registry) - from zope.deprecation import __show__ - __show__.off() - - def tearDown(self): - self.config.end() - from zope.deprecation import __show__ - __show__.on() - - def _callFUT(self): - from pyramid.settings import get_settings - return get_settings() - - def test_it_nosettings(self): - self.assertEqual(self._callFUT()['reload_templates'], False) - - def test_it_withsettings(self): - settings = {'a':1} - self.config.registry.settings = settings - self.assertEqual(self._callFUT(), settings) class Test_asbool(unittest.TestCase): def _callFUT(self, s): |
