Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.werkzeug.contrib.cache.NullCache Class Reference
Inheritance diagram for MoinMoin.support.werkzeug.contrib.cache.NullCache:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.werkzeug.contrib.cache.NullCache:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def get
def delete
def get_many
def get_dict
def set
def add
def set_many
def delete_many
def clear
def inc
def dec

Public Attributes

 default_timeout

Detailed Description

A cache that doesn't cache.  This can be useful for unit testing.

:param default_timeout: a dummy parameter that is ignored but exists
                        for API compatibility with other caches.

Definition at line 192 of file cache.py.


Member Function Documentation

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.add (   self,
  key,
  value,
  timeout = None 
) [inherited]
Works like :meth:`set` but does not override already existing
values.

:param key: the key to set
:param value: the value for the key
:param timeout: the cache timeout for the key or the default
        timeout if not specified.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.FileSystemCache, MoinMoin.support.werkzeug.contrib.cache.MemcachedCache, and MoinMoin.support.werkzeug.contrib.cache.SimpleCache.

Definition at line 133 of file cache.py.

00133 
00134     def add(self, key, value, timeout=None):
00135         """Works like :meth:`set` but does not override already existing
00136         values.
00137 
00138         :param key: the key to set
00139         :param value: the value for the key
00140         :param timeout: the cache timeout for the key or the default
00141                         timeout if not specified.
00142         """
00143         pass

Here is the caller graph for this function:

Clears the cache.  Keep in mind that not all caches support
clearning of the full cache.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.FileSystemCache, and MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 163 of file cache.py.

00163 
00164     def clear(self):
00165         """Clears the cache.  Keep in mind that not all caches support
00166         clearning of the full cache.
00167         """
00168         pass

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.dec (   self,
  key,
  delta = 1 
) [inherited]
Decrements the value of a key by `delta`.  If the key does
not yet exist it is initialized with `-delta`.

For supporting caches this is an atomic operation.

:param key: the key to increment.
:param delta: the delta to subtract.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 180 of file cache.py.

00180 
00181     def dec(self, key, delta=1):
00182         """Decrements the value of a key by `delta`.  If the key does
00183         not yet exist it is initialized with `-delta`.
00184 
00185         For supporting caches this is an atomic operation.
00186 
00187         :param key: the key to increment.
00188         :param delta: the delta to subtract.
00189         """
00190         self.set(key, (self.get(key) or 0) - delta)
00191 

Here is the call graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.delete (   self,
  key 
) [inherited]
Deletes `key` from the cache.  If it does not exist in the cache
nothing happens.

:param key: the key to delete.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.FileSystemCache, MoinMoin.support.werkzeug.contrib.cache.MemcachedCache, and MoinMoin.support.werkzeug.contrib.cache.SimpleCache.

Definition at line 89 of file cache.py.

00089 
00090     def delete(self, key):
00091         """Deletes `key` from the cache.  If it does not exist in the cache
00092         nothing happens.
00093 
00094         :param key: the key to delete.
00095         """
00096         pass

Here is the caller graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.delete_many (   self,
  keys 
) [inherited]
Deletes multiple keys at once.

:param keys: The function accepts multiple keys as positional
     arguments.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 154 of file cache.py.

00154 
00155     def delete_many(self, *keys):
00156         """Deletes multiple keys at once.
00157 
00158         :param keys: The function accepts multiple keys as positional
00159                      arguments.
00160         """
00161         for key in keys:
00162             self.delete(key)

Here is the call graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.get (   self,
  key 
) [inherited]
Looks up key in the cache and returns it.  If the key does not
exist `None` is returned instead.

:param key: the key to be looked up.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.FileSystemCache, MoinMoin.support.werkzeug.contrib.cache.MemcachedCache, and MoinMoin.support.werkzeug.contrib.cache.SimpleCache.

Definition at line 81 of file cache.py.

00081 
00082     def get(self, key):
00083         """Looks up key in the cache and returns it.  If the key does not
00084         exist `None` is returned instead.
00085 
00086         :param key: the key to be looked up.
00087         """
00088         return None

Here is the caller graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.get_dict (   self,
  keys 
) [inherited]
Works like :meth:`get_many` but returns a dict::

    d = cache.get_dict("foo", "bar")
    foo = d["foo"]
    bar = d["bar"]

:param keys: The function accepts multiple keys as positional
     arguments.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 111 of file cache.py.

00111 
00112     def get_dict(self, *keys):
00113         """Works like :meth:`get_many` but returns a dict::
00114 
00115             d = cache.get_dict("foo", "bar")
00116             foo = d["foo"]
00117             bar = d["bar"]
00118 
00119         :param keys: The function accepts multiple keys as positional
00120                      arguments.
00121         """
00122         return dict(izip(keys, self.get_many(*keys)))

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.get_many (   self,
  keys 
) [inherited]
Returns a list of keys.  For each key a item in the list is
created.  Example::

    foo, bar = cache.get_many("foo", "bar")

If a key can't be looked up `None` is returned for that key
instead.

:param keys: The function accepts multiple keys as positional
     arguments.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 97 of file cache.py.

00097 
00098     def get_many(self, *keys):
00099         """Returns a list of keys.  For each key a item in the list is
00100         created.  Example::
00101 
00102             foo, bar = cache.get_many("foo", "bar")
00103 
00104         If a key can't be looked up `None` is returned for that key
00105         instead.
00106 
00107         :param keys: The function accepts multiple keys as positional
00108                      arguments.
00109         """
00110         return map(self.get, keys)

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.inc (   self,
  key,
  delta = 1 
) [inherited]
Increments the value of a key by `delta`.  If the key does
not yet exist it is initialized with `delta`.

For supporting caches this is an atomic operation.

:param key: the key to increment.
:param delta: the delta to add.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 169 of file cache.py.

00169 
00170     def inc(self, key, delta=1):
00171         """Increments the value of a key by `delta`.  If the key does
00172         not yet exist it is initialized with `delta`.
00173 
00174         For supporting caches this is an atomic operation.
00175 
00176         :param key: the key to increment.
00177         :param delta: the delta to add.
00178         """
00179         self.set(key, (self.get(key) or 0) + delta)

Here is the call graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.set (   self,
  key,
  value,
  timeout = None 
) [inherited]
Adds or overrides a key in the cache.

:param key: the key to set
:param value: the value for the key
:param timeout: the cache timeout for the key or the default
        timeout if not specified.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.FileSystemCache, MoinMoin.support.werkzeug.contrib.cache.MemcachedCache, and MoinMoin.support.werkzeug.contrib.cache.SimpleCache.

Definition at line 123 of file cache.py.

00123 
00124     def set(self, key, value, timeout=None):
00125         """Adds or overrides a key in the cache.
00126 
00127         :param key: the key to set
00128         :param value: the value for the key
00129         :param timeout: the cache timeout for the key or the default
00130                         timeout if not specified.
00131         """
00132         pass

Here is the caller graph for this function:

def MoinMoin.support.werkzeug.contrib.cache.BaseCache.set_many (   self,
  mapping,
  timeout = None 
) [inherited]
Sets multiple keys and values from a dict.

:param mapping: a dict with the values to set.
:param timeout: the cache timeout for the key or the default
        timeout if not specified.

Reimplemented in MoinMoin.support.werkzeug.contrib.cache.MemcachedCache.

Definition at line 144 of file cache.py.

00144 
00145     def set_many(self, mapping, timeout=None):
00146         """Sets multiple keys and values from a dict.
00147 
00148         :param mapping: a dict with the values to set.
00149         :param timeout: the cache timeout for the key or the default
00150                         timeout if not specified.
00151         """
00152         for key, value in mapping.iteritems():
00153             self.set(key, value, timeout)

Here is the call graph for this function:


Member Data Documentation

Definition at line 79 of file cache.py.


The documentation for this class was generated from the following file: