summaryrefslogtreecommitdiff
path: root/repoze
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-09-28 16:18:13 +0000
committerChris McDonough <chrism@agendaless.com>2008-09-28 16:18:13 +0000
commite3c69c7c7dc09cf39e578e1df4b106745d02f48f (patch)
treecf469cf0ac1d85718ecf5182052df46734d74c5a /repoze
parent85fd25e371b381ad4e76738e8f672261a9d66d75 (diff)
downloadpyramid-e3c69c7c7dc09cf39e578e1df4b106745d02f48f.tar.gz
pyramid-e3c69c7c7dc09cf39e578e1df4b106745d02f48f.tar.bz2
pyramid-e3c69c7c7dc09cf39e578e1df4b106745d02f48f.zip
- A deprecation warning is now issued when old API names from the
``repoze.bfg.templates`` module are imported.
Diffstat (limited to 'repoze')
-rw-r--r--repoze/bfg/template.py13
-rw-r--r--repoze/bfg/tests/test_template.py4
2 files changed, 16 insertions, 1 deletions
diff --git a/repoze/bfg/template.py b/repoze/bfg/template.py
index 2f3017bd6..526e9f0c9 100644
--- a/repoze/bfg/template.py
+++ b/repoze/bfg/template.py
@@ -4,10 +4,21 @@
# ``render_template_to_response`` APIs should be imported from
# ``repoze.bfg.chameleon_zpt`` in the future for optimum correctness,
# while the ``render_transform`` and ``render_transform_to_response``
-# APIs should be imported from ``repoze.bfg.xsl``.
+# APIs should be imported from ``repoze.bfg.xslt``.
+from zope.deprecation import deprecated
from repoze.bfg.chameleon_zpt import get_template
from repoze.bfg.chameleon_zpt import render_template
from repoze.bfg.chameleon_zpt import render_template_to_response
from repoze.bfg.xslt import render_transform
from repoze.bfg.xslt import render_transform_to_response
+
+for name in ('get_template', 'render_template', 'render_template_to_response'):
+ deprecated(name,
+ ('repoze.bfg.template.%s should now be imported as '
+ 'repoze.bfg.chameleon_zpt.%s' % (name, name)))
+
+for name in ('render_transform', 'render_transform_to_response'):
+ deprecated(name,
+ ('repoze.bfg.template.%s should now be imported as '
+ 'repoze.bfg.xlst.%s' % (name, name)))
diff --git a/repoze/bfg/tests/test_template.py b/repoze/bfg/tests/test_template.py
index 42baa6492..f66d045cd 100644
--- a/repoze/bfg/tests/test_template.py
+++ b/repoze/bfg/tests/test_template.py
@@ -4,9 +4,13 @@ from zope.component.testing import PlacelessSetup
class Base(PlacelessSetup):
def setUp(self):
+ from zope.deprecation import __show__
+ __show__.off()
PlacelessSetup.setUp(self)
def tearDown(self):
+ from zope.deprecation import __show__
+ __show__.on()
PlacelessSetup.tearDown(self)
def _zcmlConfigure(self):