From 34f44d844ffe75738046a154202a6faf4d5dfc38 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 16 Nov 2010 20:50:28 -0500 Subject: - Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and ``pyramid.zcml.file_configure``. - The ``pyramid.testing.zcml_configure`` API has been removed. It had been advertised as removed since 1.2a1, but hadn't actually been. --- CHANGES.txt | 9 +++++++++ TODO.txt | 7 ------- pyramid/testing.py | 3 --- pyramid/tests/test_zcml.py | 4 ++++ pyramid/zcml.py | 12 ++++++++++++ 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d132b4e71..28637c1a7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,15 @@ Bug Fixes ``pyramid.chameleon_zpt`` of ``get_renderer``, ``get_template``, ``render_template``, and ``render_template_to_response``. +- Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and + ``pyramid.zcml.file_configure``. + +Backwards Incompatibilities +--------------------------- + +- The ``pyramid.testing.zcml_configure`` API has been removed. It had been + advertised as removed since 1.2a1, but hadn't actually been. + Deprecations ------------ diff --git a/TODO.txt b/TODO.txt index 33d39a825..759b9bb70 100644 --- a/TODO.txt +++ b/TODO.txt @@ -118,11 +118,4 @@ Configurator.add_translation_dirs: not passed any context but a message, can't credibly be removed. -- Add deprecation warnings for: - - - settings.get_settings - - - zcml.zcml_configure - - - zcml.file_configure diff --git a/pyramid/testing.py b/pyramid/testing.py index 84ab77935..4bc4728c0 100644 --- a/pyramid/testing.py +++ b/pyramid/testing.py @@ -20,9 +20,6 @@ from pyramid.security import Everyone from pyramid.security import has_permission from pyramid.threadlocal import get_current_registry from pyramid.threadlocal import manager -from pyramid.zcml import zcml_configure # API - -zcml_configure # prevent pyflakes from complaining _marker = object() diff --git a/pyramid/tests/test_zcml.py b/pyramid/tests/test_zcml.py index f4a6e81b6..905a53287 100644 --- a/pyramid/tests/test_zcml.py +++ b/pyramid/tests/test_zcml.py @@ -803,6 +803,8 @@ class TestZCMLConfigure(unittest.TestCase): return zcml_configure(path, package) def setUp(self): + from zope.deprecation import __show__ + __show__.off() testing.setUp() self.tempdir = None import sys @@ -822,6 +824,8 @@ class TestZCMLConfigure(unittest.TestCase): self.tempdir = tempdir def tearDown(self): + from zope.deprecation import __show__ + __show__.on() testing.tearDown() import sys import shutil diff --git a/pyramid/zcml.py b/pyramid/zcml.py index a2fdec314..3104ebac0 100644 --- a/pyramid/zcml.py +++ b/pyramid/zcml.py @@ -6,6 +6,8 @@ from zope.configuration.fields import GlobalInterface from zope.configuration.fields import GlobalObject from zope.configuration.fields import Tokens +from zope.deprecation import deprecated + from zope.interface import Interface from zope.interface import implementedBy from zope.interface import providedBy @@ -937,6 +939,16 @@ def zcml_configure(name, package): file_configure = zcml_configure # backwards compat (>0.8.1) +deprecated( + 'zcml_configure', + '(pyramid.zcml.zcml_configure is deprecated as of Pyramid 1.0. Use' + '``pyramid.configuration.Configurator.load_zcml`` instead.) ') + +deprecated( + 'file_configure', + '(pyramid.zcml.file_configure is deprecated as of Pyramid 1.0. Use' + '``pyramid.configuration.Configurator.load_zcml`` instead.) ') + def _rolledUpFactory(factories): def factory(ob): for f in factories: -- cgit v1.2.3