From 3e2a692f4ee839d6c17850b51af9501a4d074a03 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Tue, 5 Jul 2016 11:25:00 -0600 Subject: Remove cachebust_match It was leftover from when this feature was removed in the 1.6 release cycle --- pyramid/static.py | 5 +---- pyramid/tests/test_static.py | 8 -------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/pyramid/static.py b/pyramid/static.py index 0965be95c..3abcd465c 100644 --- a/pyramid/static.py +++ b/pyramid/static.py @@ -83,7 +83,7 @@ class static_view(object): """ def __init__(self, root_dir, cache_max_age=3600, package_name=None, - use_subpath=False, index='index.html', cachebust_match=None): + use_subpath=False, index='index.html'): # package_name is for bw compat; it is preferred to pass in a # package-relative path as root_dir # (e.g. ``anotherpackage:foo/static``). @@ -96,15 +96,12 @@ class static_view(object): self.docroot = docroot self.norm_docroot = normcase(normpath(docroot)) self.index = index - self.cachebust_match = cachebust_match def __call__(self, context, request): if self.use_subpath: path_tuple = request.subpath else: path_tuple = traversal_path_info(request.environ['PATH_INFO']) - if self.cachebust_match: - path_tuple = self.cachebust_match(path_tuple) path = _secure_path(path_tuple) if path is None: diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py index 2ca86bc44..e264652dd 100644 --- a/pyramid/tests/test_static.py +++ b/pyramid/tests/test_static.py @@ -113,14 +113,6 @@ class Test_static_view_use_subpath_False(unittest.TestCase): response = inst(context, request) self.assertTrue(b'static' in response.body) - def test_cachebust_match(self): - inst = self._makeOne('pyramid.tests:fixtures/static') - inst.cachebust_match = lambda subpath: subpath[1:] - request = self._makeRequest({'PATH_INFO':'/foo/index.html'}) - context = DummyContext() - response = inst(context, request) - self.assertTrue(b'static' in response.body) - def test_resource_is_file_with_wsgi_file_wrapper(self): from pyramid.response import _BLOCK_SIZE inst = self._makeOne('pyramid.tests:fixtures/static') -- cgit v1.2.3