Ñò
§ÚêLc @ sk d Z d d k Z d d k Z d d k Z e i Z d Z e Z d e i
f d „ ƒ YZ d d d „ Z d S( s 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')
iÿÿÿÿNi t _Databasec B s¶ e Z e Z e Z d „ Z d „ Z d „ Z e Z d „ Z d „ Z d „ Z
d „ Z d „ Z d „ Z
d „ Z d
„ Z d „ Z d „ Z e Z d
„ Z d „ Z e Z d „ Z RS( c C s´ | | _ | t i d | _ | t i d | _ | t i d | _ d | _ y t | i d ƒ } Wn5 t j
o) t | i d ƒ } | i
| i ƒ n X| i ƒ | i ƒ d S( Nt dirt datt bakt rt w(
t _modet _ost extsept _dirfilet _datfilet _bakfilet Nonet _indext _opent IOErrort _chmodt closet _update( t selft filebasenamet modet f( ( s /usr/lib64/python2.6/dumbdbm.pyt __init__/ s
c C s| h | _ y t | i ƒ } Wn t j
o nH Xx9 | D]1 } | i ƒ } t | ƒ \ } } | | i |