From 2c4f4e3cbd1b5b56bb17d2348df3c397efd0a8e4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 8 Sep 2013 20:39:39 -0400 Subject: - Removed the class named ``pyramid.view.static`` that had been deprecated since Pyramid 1.1. Instead use ``pyramid.static.static_view`` with ``use_subpath=True`` argument. --- CHANGES.txt | 4 ++++ docs/api/view.rst | 4 ---- pyramid/tests/test_view.py | 18 ------------------ pyramid/view.py | 23 ----------------------- 4 files changed, 4 insertions(+), 45 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a26336a00..42ba8b3ce 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -73,6 +73,10 @@ Backwards Incompatibilities were executed. Rationale: it's more useful to be able to inspect the response after response callbacks have done their jobs instead of before. +- Removed the class named ``pyramid.view.static`` that had been deprecated + since Pyramid 1.1. Instead use ``pyramid.static.static_view`` with + ``use_subpath=True`` argument. + 1.5a1 (2013-08-30) ================== diff --git a/docs/api/view.rst b/docs/api/view.rst index 21d2bb90d..e79e1b505 100644 --- a/docs/api/view.rst +++ b/docs/api/view.rst @@ -25,8 +25,4 @@ .. autoclass:: forbidden_view_config :members: - .. autoclass:: static - :members: - :inherited-members: - diff --git a/pyramid/tests/test_view.py b/pyramid/tests/test_view.py index a0d476662..bd7e635dd 100644 --- a/pyramid/tests/test_view.py +++ b/pyramid/tests/test_view.py @@ -673,24 +673,6 @@ class Test_default_exceptionresponse_view(unittest.TestCase): result = self._callFUT(context, request) self.assertEqual(result, 'abc') -class Test_static(unittest.TestCase): - def setUp(self): - from zope.deprecation import __show__ - __show__.off() - - def tearDown(self): - from zope.deprecation import __show__ - __show__.on() - - def _makeOne(self, path, package_name): - from pyramid.view import static - return static(path, package_name) - - def test_it(self): - path = 'fixtures' - view = self._makeOne(path, None) - self.assertEqual(view.docroot, 'fixtures') - class Test_view_defaults(unittest.TestCase): def test_it(self): from pyramid.view import view_defaults diff --git a/pyramid/view.py b/pyramid/view.py index b64db69d2..1ef8faab3 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -20,33 +20,10 @@ from pyramid.httpexceptions import ( default_exceptionresponse_view, ) -from pyramid.path import caller_package -from pyramid.static import static_view from pyramid.threadlocal import get_current_registry _marker = object() -class static(static_view): - """ Backwards compatibility alias for - :class:`pyramid.static.static_view`; it overrides that class' constructor - to pass ``use_subpath=True`` by default. - - .. deprecated:: 1.1 - use :class:`pyramid.static.static_view` instead - (probably with a ``use_subpath=True`` argument) - """ - def __init__(self, root_dir, cache_max_age=3600, package_name=None): - if package_name is None: - package_name = caller_package().__name__ - static_view.__init__(self, root_dir, cache_max_age=cache_max_age, - package_name=package_name, use_subpath=True) - -deprecated( - 'static', - 'The "pyramid.view.static" class is deprecated as of Pyramid 1.1; ' - 'use the "pyramid.static.static_view" class instead with the ' - '"use_subpath" argument set to True.') - def render_view_to_response(context, request, name='', secure=True): """ Call the :term:`view callable` configured with a :term:`view configuration` that matches the :term:`view name` ``name`` -- cgit v1.2.3