ó zfc@swdZddlZddlZddlZddlZejZdZ e Z dej fd„ƒYZ ddd„ZdS(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ÿÿÿÿNit _DatabasecBs¹eZeZeZdd„Zd„Zd„ZeZd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „ZeZd„Zd„ZeZd„ZRS(tccCsÊ||_|dk|_|tjd|_|tjd|_|tjd|_d|_yt |jdƒ}Wn<t k r±t |jdƒ}|j |jƒWdQXn X|j ƒ|j ƒdS(Ntrtdirtdattbaktw(t_modet _readonlyt_ostextsept_dirfilet_datfilet_bakfiletNonet_indext_opentIOErrort_chmodtcloset_update(tselft filebasenametmodetflagtf((s/usr/lib64/python2.7/dumbdbm.pyt__init__0s    cCs–i|_yt|jƒ}Wntk r<|j |_nVXt|_|Dx<|D]4}|jƒ}tj |ƒ\}}||j|s     Á