webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Static Public Attributes | List of all members
cache.CachedInfo Class Reference
Inheritance diagram for cache.CachedInfo:
planet.Channel planet.NewsItem

Public Member Functions

def __init__ (self, cache, id_, root=0)
 
def cache_key (self, key)
 
def cache_read (self)
 
def cache_write (self, sync=1)
 
def cache_clear (self, sync=1)
 
def has_key (self, key)
 
def key_type (self, key)
 
def set (self, key, value, cached=1)
 
def get (self, key)
 
def set_as_string (self, key, value, cached=1)
 
def get_as_string (self, key)
 
def set_as_date (self, key, value, cached=1)
 
def get_as_date (self, key)
 
def set_as_null (self, key, value, cached=1)
 
def get_as_null (self, key)
 
def del_key (self, key)
 
def keys (self)
 
def __iter__ (self)
 
def __setattr__ (self, key, value)
 
def __getattr__ (self, key)
 

Static Public Attributes

 STRING
 
 DATE
 
 NULL
 

Detailed Description

Cached information.

This class is designed to hold information that is stored in a cache
between instances.  It can act both as a dictionary (c['foo']) and
as an object (c.foo) to get and set values and supports both string
and date values.

If you wish to support special fields you can derive a class off this
and implement get_FIELD and set_FIELD functions which will be
automatically called.

Constructor & Destructor Documentation

◆ __init__()

def cache.CachedInfo.__init__ (   self,
  cache,
  id_,
  root = 0 
)

Member Function Documentation

◆ __getattr__()

def cache.CachedInfo.__getattr__ (   self,
  key 
)

◆ __iter__()

def cache.CachedInfo.__iter__ (   self)
Iterate the cached keys.

◆ __setattr__()

def cache.CachedInfo.__setattr__ (   self,
  key,
  value 
)

◆ cache_clear()

def cache.CachedInfo.cache_clear (   self,
  sync = 1 
)
Remove information from the cache.

◆ cache_key()

def cache.CachedInfo.cache_key (   self,
  key 
)
Return the cache key name for the given key.

◆ cache_read()

def cache.CachedInfo.cache_read (   self)
Read information from the cache.

◆ cache_write()

def cache.CachedInfo.cache_write (   self,
  sync = 1 
)
Write information to the cache.

◆ del_key()

def cache.CachedInfo.del_key (   self,
  key 
)
Delete the given key.

◆ get()

def cache.CachedInfo.get (   self,
  key 
)
Return the value of the given key.

If a get_KEY function exists that is called otherwise the
correctly typed function is called if that exists.

◆ get_as_date()

def cache.CachedInfo.get_as_date (   self,
  key 
)
Return the key as a date value.

◆ get_as_null()

def cache.CachedInfo.get_as_null (   self,
  key 
)
Return the key as the null value.

◆ get_as_string()

def cache.CachedInfo.get_as_string (   self,
  key 
)
Return the key as a string value.

◆ has_key()

def cache.CachedInfo.has_key (   self,
  key 
)
Check whether the key exists.

◆ key_type()

def cache.CachedInfo.key_type (   self,
  key 
)
Return the key type.

◆ keys()

def cache.CachedInfo.keys (   self)
Return the list of cached keys.

◆ set()

def cache.CachedInfo.set (   self,
  key,
  value,
  cached = 1 
)
Set the value of the given key.

If a set_KEY function exists that is called otherwise the
string function is called and the date function if that fails
(it nearly always will).

◆ set_as_date()

def cache.CachedInfo.set_as_date (   self,
  key,
  value,
  cached = 1 
)
Set the key to the date value.

The date should be a 9-item tuple as returned by time.gmtime().

◆ set_as_null()

def cache.CachedInfo.set_as_null (   self,
  key,
  value,
  cached = 1 
)
Set the key to the null value.

This only exists to make things less magic.

◆ set_as_string()

def cache.CachedInfo.set_as_string (   self,
  key,
  value,
  cached = 1 
)
Set the key to the string value.

The value is converted to UTF-8 if it is a Unicode string, otherwise
it's assumed to have failed decoding (feedparser tries pretty hard)
so has all non-ASCII characters stripped.

Member Data Documentation

◆ DATE

cache.CachedInfo.DATE
static

◆ NULL

cache.CachedInfo.NULL
static

◆ STRING

cache.CachedInfo.STRING
static

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