Module Expr Str Import alias identifier Import alias Import alias Assign NameStore AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore NameLoad ClassDef bases AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd NameLoad AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd NameLoad AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd NameLoad AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass orelse For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Return TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Pass TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Pass Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Num Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore BinOpMult BinOpFloorDiv BinOpSub BinOpAdd NameLoad NameLoad Num NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMult Str BinOpSub NameLoad NameLoad Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If UnaryOpNot CompareEqEq Call NameLoad NameLoad Call NameLoad Str Call NameLoad NameLoad body Raise NameLoad Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore BinOpFloorDiv BinOpSub BinOpAdd NameLoad NameLoad Num NameLoad Assign NameStore BinOpFloorDiv BinOpSub BinOpAdd Call NameLoad NameLoad NameLoad Num NameLoad If CompareLtE NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeStore NameLoad attr AttributeStore NameLoad attr AttributeStore NameLoad attr NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass orelse Assign NameStore BinOpBitAnd NameLoad UnaryOpInvert NameLoad Return Call NameLoad NameLoad NameLoad decorator_list
N/A N/A A dumb and slow but simple dbm clone.

For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).

XXX TO DO:

- seems to contain a bug when updating...

- reclaim free space (currently, space once occupied by deleted or expanded
items is never reused)

- support concurrent access (currently, if two processes take turns making
updates, they can mess up the index)

- support efficient access to large databases (currently, the whole index
is read when the database is opened, and some updates rewrite the whole index)

- support opening for read-only (flag = 'm')

 N/A os _os N/A __builtin__ N/A UserDict N/A _open N/A __builtin__ open N/A _BLOCKSIZE 512 N/A error IOError _Database N/A N/A UserDict DictMixin N/A N/A _os _os N/A _open _open __init__ N/A N/A self filebasename mode N/A N/A N/A N/A self _mode mode N/A N/A self _dirfile N/A N/A filebasename N/A _os extsep dir N/A N/A self _datfile N/A N/A filebasename N/A _os extsep dat N/A N/A self _bakfile N/A N/A filebasename N/A _os extsep bak N/A N/A self _index None N/A N/A N/A f N/A _open N/A self _datfile r N/A N/A N/A IOError N/A N/A f N/A _open N/A self _datfile w N/A N/A N/A self _chmod N/A self _datfile N/A N/A N/A f close N/A N/A N/A self _update N/A _update N/A N/A self N/A N/A N/A N/A self _index N/A N/A N/A N/A f N/A _open N/A self _dirfile N/A N/A N/A IOError N/A N/A N/A N/A line f N/A N/A line N/A N/A line rstrip N/A N/A key pos_and_siz_pair N/A eval line N/A N/A N/A self _index N/A key pos_and_siz_pair N/A N/A N/A f close N/A _commit N/A N/A self N/A N/A N/A N/A N/A self _index None N/A N/A N/A N/A N/A N/A N/A N/A self _os unlink N/A self _bakfile N/A N/A N/A N/A N/A self _os error N/A N/A N/A N/A N/A N/A N/A N/A self _os rename N/A self _dirfile N/A self _bakfile N/A N/A N/A N/A N/A self _os error N/A N/A N/A f N/A N/A self _open N/A self _dirfile w N/A N/A N/A self _chmod N/A self _dirfile N/A N/A key pos_and_siz_pair N/A N/A N/A self _index iteritems N/A N/A N/A N/A f write N/A %r, %r
 N/A key pos_and_siz_pair N/A N/A N/A f close N/A N/A sync _commit __getitem__ N/A N/A self key N/A N/A N/A N/A pos siz N/A N/A self _index N/A key N/A f N/A _open N/A self _datfile rb N/A N/A N/A f seek pos N/A dat N/A N/A f read siz N/A N/A N/A f close N/A dat N/A _addval N/A N/A self val N/A N/A N/A f N/A _open N/A self _datfile rb+ N/A N/A N/A f seek 0 2 N/A pos N/A int N/A N/A f tell N/A npos N/A N/A N/A N/A pos _BLOCKSIZE 1 _BLOCKSIZE _BLOCKSIZE N/A N/A N/A f write N/A N/A npos pos N/A pos npos N/A N/A N/A f write val N/A N/A N/A f close N/A N/A pos N/A len val N/A _setval N/A N/A self pos val N/A N/A N/A f N/A _open N/A self _datfile rb+ N/A N/A N/A f seek pos N/A N/A N/A f write val N/A N/A N/A f close N/A N/A pos N/A len val N/A _addkey N/A N/A self key pos_and_siz_pair N/A N/A N/A N/A N/A self _index N/A key pos_and_siz_pair N/A f N/A _open N/A self _dirfile a N/A N/A N/A self _chmod N/A self _dirfile N/A N/A N/A f write N/A %r, %r
 N/A key pos_and_siz_pair N/A N/A N/A f close N/A __setitem__ N/A N/A self key val N/A N/A N/A N/A N/A N/A type key N/A type N/A type val N/A N/A TypeError keys and values must be strings N/A N/A key N/A self _index N/A N/A N/A N/A self _addkey key N/A N/A self _addval val N/A N/A N/A pos siz N/A N/A self _index N/A key N/A oldblocks N/A N/A N/A siz _BLOCKSIZE 1 _BLOCKSIZE N/A newblocks N/A N/A N/A N/A len val _BLOCKSIZE 1 _BLOCKSIZE N/A N/A newblocks oldblocks N/A N/A N/A N/A self _index N/A key N/A N/A self _setval pos val N/A N/A N/A N/A self _index N/A key N/A N/A self _addval val N/A __delitem__ N/A N/A self key N/A N/A N/A N/A N/A self _index N/A key N/A N/A N/A self _commit N/A keys N/A N/A self N/A N/A N/A N/A N/A N/A self _index keys N/A has_key N/A N/A self key N/A N/A N/A N/A key N/A self _index N/A __contains__ N/A N/A self key N/A N/A N/A N/A key N/A self _index N/A iterkeys N/A N/A self N/A N/A N/A N/A N/A N/A self _index iterkeys N/A N/A __iter__ iterkeys __len__ N/A N/A self N/A N/A N/A N/A len N/A self _index N/A close N/A N/A self N/A N/A N/A N/A N/A self _commit N/A N/A self _index N/A self _datfile N/A self _dirfile N/A self _bakfile None N/A N/A __del__ close _chmod N/A N/A self file N/A N/A N/A N/A hasattr N/A self _os chmod N/A N/A N/A N/A N/A self _os chmod file N/A self _mode N/A N/A open N/A N/A file flag mode N/A None 438 N/A N/A Open the database file, filename, and return corresponding object.

    The flag argument, used to control how the database is opened in the
    other DBM implementations, is ignored in the dumbdbm module; the
    database is always opened for update, and will be created if it does
    not exist.

    The optional mode argument is the UNIX mode of the file, used only when
    the database has to be created.  It defaults to octal code 0666 (and
    will be modified by the prevailing umask).

     N/A N/A N/A um N/A N/A _os umask 0 N/A N/A N/A _os umask um N/A N/A N/A AttributeError N/A N/A N/A N/A mode N/A mode N/A um N/A N/A _Database file mode N/A