diff --git a/util/cache.py b/util/cache.py index a606e7e..14268a3 100644 --- a/util/cache.py +++ b/util/cache.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Helmut Merz helmutm@cy55.de +# Copyright (c) 2010 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ class CacheItem(object): self.value = INVALID -def cache(getIdentifier, lifetime=3600): +def internalCache(getIdentifier, lifetime=3600): def _cache(fct): def __cache(*args, **kw): id = getIdentifier(*args, **kw) @@ -76,6 +76,8 @@ def cache(getIdentifier, lifetime=3600): return __cache return _cache +cache = internalCache + # memcached implementation diff --git a/util/cache.txt b/util/cache.txt index e6ed568..4982842 100644 --- a/util/cache.txt +++ b/util/cache.txt @@ -4,7 +4,8 @@ Data Caching $Id$ - >>> from cybertools.util.cache import cache + >>> from cybertools.util import cache + >>> cache = cache.internalCache >>> @cache(lambda *args: 'calc') ... def calculate():