diff options
| author | tosh <toshism@gmail.com> | 2017-06-27 11:26:47 -0500 |
|---|---|---|
| committer | tosh <toshism@gmail.com> | 2017-06-27 11:26:47 -0500 |
| commit | 0afdad53997f96fa6e800d25e2a98c25653b9d38 (patch) | |
| tree | 3d0c118e6f865046fd642b58ee4f7d1a2a22c145 | |
| parent | eb596cbc0561b745d34385bc5d0c04aa01abfaa9 (diff) | |
| download | pyramid-0afdad53997f96fa6e800d25e2a98c25653b9d38.tar.gz pyramid-0afdad53997f96fa6e800d25e2a98c25653b9d38.tar.bz2 pyramid-0afdad53997f96fa6e800d25e2a98c25653b9d38.zip | |
rename view_config argmuent category to _category
| -rw-r--r-- | pyramid/tests/test_view.py | 2 | ||||
| -rw-r--r-- | 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) |
