incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] git commit: [#5699] cleanup of unused untested util functions
Date Tue, 29 Jan 2013 16:19:16 GMT
Updated Branches:
  refs/heads/db/5699 1b8d1d093 -> 3f58952ce


[#5699] cleanup of unused untested util functions


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/3f58952c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3f58952c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3f58952c

Branch: refs/heads/db/5699
Commit: 3f58952ce421f223037e94b1ee867720483b7b6e
Parents: 92d4608
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Tue Jan 29 16:19:10 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Tue Jan 29 16:19:10 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/utils.py |   43 ---------------------------------------
 1 files changed, 0 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3f58952c/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index f23f0c1..fa63b38 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -35,41 +35,6 @@ def permanent_redirect(url):
     except exc.HTTPFound, err:
         raise exc.HTTPMovedPermanently(location=err.location)
 
-def cache_forever():
-    headers = [
-        (k,v) for k,v in response.headers.items()
-        if k.lower() not in ('pragma', 'cache-control') ]
-    delta = CACHE_CONTROL.apply(
-        headers,
-        public=True,
-        max_age=60*60*24*365)
-    EXPIRES.update(headers, delta=delta)
-    response.headers.pop('cache-control', None)
-    response.headers.pop('pragma', None)
-    response.headers.update(headers)
-
-class memoize_on_request(object):
-
-    def __init__(self, *key, **kwargs):
-        self.key = key
-        self.include_func_in_key = kwargs.pop(
-            'include_func_in_key', False)
-        assert not kwargs, 'Extra args'
-
-    def __call__(self, func):
-        def wrapper(*args, **kwargs):
-            cache = c.memoize_cache
-            if self.include_func_in_key:
-                key = (func, self.key, args, tuple(kwargs.iteritems()))
-            else:
-                key = (self.key, args, tuple(kwargs.iteritems()))
-            if key in cache:
-                result = cache[key]
-            else:
-                result = cache[key] = func(*args, **kwargs)
-            return result
-        wrapper.__name__ = 'wrap(%s)' % func.__name__
-        return wrapper
 
 def guess_mime_type(filename):
     '''Guess MIME type based on filename.
@@ -475,11 +440,3 @@ def take_while_true(source):
         yield x
         x = source()
 
-def index_matching(pred, seq):
-    '''Return the index of the first item from seq matching the predicate.
-
-    If no items match the predicate, None is returned instead.'''
-    for i,x in enumerate(seq):
-        if pred(x):
-            return i
-    return None


Mime
View raw message