class documentation

class FileBasedCache(BaseCache): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method add Undocumented
Method clear Remove all the cache files.
Method delete Undocumented
Method get Undocumented
Method has_key Undocumented
Method set Undocumented
Method touch Undocumented
Class Variable cache_suffix Undocumented
Method _createdir Undocumented
Method _cull Remove random cache entries if max_entries is reached at a ratio of num_entries / cull_frequency. A value of 0 for CULL_FREQUENCY means that the entire cache will be purged.
Method _delete Undocumented
Method _is_expired Take an open cache file `f` and delete it if it's expired.
Method _key_to_file Convert a key into a cache file path. Basically this is the root cache path joined with the md5sum of the key and a suffix.
Method _list_cache_files Get a list of paths to all the cache files. These are all the files in the root cache dir that end on the cache_suffix.
Method _write_content Undocumented
Instance Variable _dir Undocumented
def __init__(self, dir, params): (source)

Undocumented

def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): (source)

Undocumented

def clear(self): (source)

Remove all the cache files.

def delete(self, key, version=None): (source)

Undocumented

def get(self, key, default=None, version=None): (source)

Undocumented

def has_key(self, key, version=None): (source)

Undocumented

def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): (source)

Undocumented

def touch(self, key, timeout=DEFAULT_TIMEOUT, version=None): (source)

Undocumented

cache_suffix: str = (source)

Undocumented

def _createdir(self): (source)

Undocumented

def _cull(self): (source)

Remove random cache entries if max_entries is reached at a ratio of num_entries / cull_frequency. A value of 0 for CULL_FREQUENCY means that the entire cache will be purged.

def _delete(self, fname): (source)

Undocumented

def _is_expired(self, f): (source)

Take an open cache file `f` and delete it if it's expired.

def _key_to_file(self, key, version=None): (source)

Convert a key into a cache file path. Basically this is the root cache path joined with the md5sum of the key and a suffix.

def _list_cache_files(self): (source)

Get a list of paths to all the cache files. These are all the files in the root cache dir that end on the cache_suffix.

def _write_content(self, file, timeout, value): (source)

Undocumented

Undocumented