def __init__(self, table, params): BaseCache.__init__(self, params) self._table = table class CacheEntry(object): _meta = Options(table) self.cache_model_class = CacheEntry
def test_cache_key_memcache_validation(self): """ Handle cache key creation correctly, see #17861. """ name = "/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + "\x16" + "\xb4" cache_key = storage.staticfiles_storage.cache_key(name) cache_validator = BaseCache({}) cache_validator.validate_key(cache_key) self.assertEqual(cache_key, 'staticfiles:821ea71ef36f95b3922a77f7364670e7')
def __init__(self, name, params): BaseCache.__init__(self, params) global _caches, _expire_info, _locks self._cache = _caches.setdefault(name, {}) self._expire_info = _expire_info.setdefault(name, {}) self._lock = _locks.setdefault(name, RWLock())
def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs)
def __init__(self, dir, params): BaseCache.__init__(self, params) self._dir = dir if not os.path.exists(self._dir): self._createdir()