From 0afdad53997f96fa6e800d25e2a98c25653b9d38 Mon Sep 17 00:00:00 2001 From: tosh Date: Tue, 27 Jun 2017 11:26:47 -0500 Subject: rename view_config argmuent category to _category --- pyramid/tests/test_view.py | 2 +- pyramid/view.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyramid/tests/test_view.py b/pyramid/tests/test_view.py index 43459947c..7a1c90deb 100644 --- a/pyramid/tests/test_view.py +++ b/pyramid/tests/test_view.py @@ -577,7 +577,7 @@ class TestViewConfigDecorator(unittest.TestCase): self.assertEqual(category, 'pyramid') def test_call_withcategory(self): - decorator = self._makeOne(category='not_pyramid') + decorator = self._makeOne(_category='not_pyramid') venusian = DummyVenusian() decorator.venusian = venusian def foo(): pass diff --git a/pyramid/view.py b/pyramid/view.py index e5db6cea4..3b2bafa27 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -186,7 +186,7 @@ class view_config(object): out, its default will be the equivalent ``add_view`` default. Two additional keyword arguments which will be passed to the - :term:`venusian` ``attach`` function are ``_depth`` and ``category``. + :term:`venusian` ``attach`` function are ``_depth`` and ``_category``. ``_depth`` is provided for people who wish to reuse this class from another decorator. The default value is ``0`` and should be specified relative to @@ -195,7 +195,7 @@ class view_config(object): Venusian checks if the decorator is being used in a class or module context. It's not often used, but it can be useful in this circumstance. - ``category`` sets the decorator category name. It can be useful in + ``_category`` sets the decorator category name. It can be useful in combination with the ``category`` argument of ``scan`` to control which views should be processed. @@ -222,7 +222,7 @@ class view_config(object): def __call__(self, wrapped): settings = self.__dict__.copy() depth = settings.pop('_depth', 0) - category = settings.pop('category', 'pyramid') + category = settings.pop('_category', 'pyramid') def callback(context, name, ob): config = context.config.with_package(info.module) -- cgit v1.2.3