Package Bio :: Package config :: Module DBRegistry :: Class DBObject
[hide private]
[frames] | no frames]

Class DBObject

source code

Registry.RegisterableObject --+
                              |
                             DBObject
Known Subclasses:

This is a base class for dictionary-like interfaces to
databases.

Methods:
get                  Lookup a key in a database, with a default value.
get_as               Lookup a key and convert to an object.
__getitem__          Lookup a key in a database.

    THE FOLLOWING SHOULD BE IMPLEMENTED IN A DERIVED CLASS.
_get                 Return the data indicated by key.
_convert_to          Convert the data to another object.
    IMPLEMENT THESE ONLY IF TIMEOUT OR CONCURRENT ACCESS IS NEEDED.
_make_pickleable     Make the object returned by _get to a pickleable.
_unmake_pickleable   Turn the pickleable object back into the original

Instance Methods [hide private]
 
__init__(self, name, abbrev=None, doc=None, delay=None)
DBObject(name[, abbrev][, doc][, delay])
source code
 
set(self, key, data) source code
data
get(S, key, default=...) source code
 
get_as(self, key, to_io=None, default=None)
S.get_as(key[, to_io][, default]) -> object
source code
 
__getitem__(self, key) source code
data
_get(S, key) source code
another data type
_convert_to(S, data, to_io) source code
 
_set(S, key, data) source code
pickleable_obj
_make_pickleable(S, key, data) source code
data
_unmake_pickleable(S, key, pickleable_obj) source code
Method Details [hide private]

__init__(self, name, abbrev=None, doc=None, delay=None)
(Constructor)

source code 

DBObject(name[, abbrev][, doc][, delay])

Overrides: Registry.RegisterableObject.__init__