summaryrefslogtreecommitdiff
path: root/pyramid/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyramid/settings.py')
-rw-r--r--pyramid/settings.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pyramid/settings.py b/pyramid/settings.py
index 96ad3336a..64b108421 100644
--- a/pyramid/settings.py
+++ b/pyramid/settings.py
@@ -1,5 +1,6 @@
import os
+from zope.deprecation import deprecated
from zope.interface import implements
from pyramid.interfaces import ISettings
@@ -75,10 +76,22 @@ def get_settings():
.. note:: the
:class:`pyramid.configuration.Configurator.get_settings` method
performs the same duty.
+
+ .. warning:: This method is deprecated as of Pyramid 1.0. Use
+ ``pyramid.threadlocals.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.threadlocals.get_current_registry().settings`` instead or use '
+ 'the ``settings`` attribute of the registry available from the request '
+ '(``request.registry.settings``)).')
+
def asbool(s):
""" Return the boolean value ``True`` if the case-lowered value of string
input ``s`` is any of ``t``, ``true``, ``y``, ``on``, or ``1``, otherwise