Permalink
Browse files

- 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``).
  • Loading branch information...
1 parent b274d05 commit ef2e51792e4f2b970d23186dd883ad4fbf7d0815 @mcdonc mcdonc committed Sep 9, 2012
Showing with 6 additions and 56 deletions.
  1. +6 −0 CHANGES.txt
  2. +0 −2 TODO.txt
  3. +0 −2 docs/api/settings.rst
  4. +0 −26 pyramid/settings.py
  5. +0 −26 pyramid/tests/test_settings.py
View
@@ -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
------------
View
@@ -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.
View
@@ -5,8 +5,6 @@
.. automodule:: pyramid.settings
- .. autofunction:: get_settings
-
.. autofunction:: asbool
.. autofunction:: aslist
View
@@ -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):
@@ -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):

0 comments on commit ef2e517

Please sign in to comment.