Class t.p.d.Shelf(DirDBM):

Part of twisted.persisted.dirdbm View Source View In Hierarchy

A directory with a DBM shelf interface.

This class presents a hash-like interface to a directory of small, flat files. Keys must be strings, but values can be any given object.
Method __setitem__ shelf[foo] = bar
Method __getitem__ dirdbm[foo]

Inherited from DirDBM:

Method __init__
Method _encode Encode a key so it can be used as a filename.
Method _decode Decode a filename to get the key.
Method _readFile Read in the contents of a file.
Method _writeFile Write data to a file.
Method __len__
Method __delitem__ del dirdbm[foo]
Method keys
Method values
Method items
Method has_key
Method setdefault
Method get
Method __contains__ key in dirdbm
Method update Add all the key/value pairs in dict to this dirdbm. Any conflicting
Method copyTo Copy the contents of this dirdbm to the dirdbm at path.
Method clear Delete all key/value pairs in this dirdbm.
Method close Close this dbm: no-op, for dbm-style interface compliance.
Method getModificationTime Returns modification time of an entry.
def __setitem__(self, k, v): (source)
shelf[foo] = bar Create or modify a textfile in this directory.
ParameterskThe key to set (type: str )
vThe value to associate with key
def __getitem__(self, k): (source)
dirdbm[foo] Get and unpickle the contents of a file in this directory.
ParameterskThe key to lookup (type: str )
ReturnsThe value associated with the given key
RaisesKeyErrorRaised if the given key does not exist
API Documentation for twisted, generated by pydoctor.