webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
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 | |
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.
def cache.CachedInfo.__init__ | ( | self, | |
cache, | |||
id_, | |||
root = 0 |
|||
) |
def cache.CachedInfo.__getattr__ | ( | self, | |
key | |||
) |
def cache.CachedInfo.__iter__ | ( | self | ) |
Iterate the cached keys.
def cache.CachedInfo.__setattr__ | ( | self, | |
key, | |||
value | |||
) |
def cache.CachedInfo.cache_clear | ( | self, | |
sync = 1 |
|||
) |
Remove information from the cache.
def cache.CachedInfo.cache_key | ( | self, | |
key | |||
) |
Return the cache key name for the given key.
def cache.CachedInfo.cache_read | ( | self | ) |
Read information from the cache.
def cache.CachedInfo.cache_write | ( | self, | |
sync = 1 |
|||
) |
Write information to the cache.
def cache.CachedInfo.del_key | ( | self, | |
key | |||
) |
Delete the given key.
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.
def cache.CachedInfo.get_as_date | ( | self, | |
key | |||
) |
Return the key as a date value.
def cache.CachedInfo.get_as_null | ( | self, | |
key | |||
) |
Return the key as the null value.
def cache.CachedInfo.get_as_string | ( | self, | |
key | |||
) |
Return the key as a string value.
def cache.CachedInfo.has_key | ( | self, | |
key | |||
) |
Check whether the key exists.
def cache.CachedInfo.key_type | ( | self, | |
key | |||
) |
Return the key type.
def cache.CachedInfo.keys | ( | self | ) |
Return the list of cached keys.
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).
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().
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.
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.
|
static |
|
static |
|
static |