file_get_contents
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
lib64
/
python2.7
/
Filename :
dumbdbm.pyc
back
Copy
� zfc�����������@���sw���d��Z��d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�e�j�Z�d�Z �e �Z�d�e�j�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��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(���t���cc���������C���s����|�|��_��|�d�k�|��_�|�t�j�d�|��_�|�t�j�d�|��_�|�t�j�d�|��_�d��|��_�y�t �|��j�d���}�Wn<�t �k �r��t �|��j�d�����}�|��j�|��j���Wd��QXn�X|�j����|��j ����d��S(���Nt���rt���dirt���datt���bakt���w(���t���_modet ���_readonlyt���_ost���extsept���_dirfilet���_datfilet���_bakfilet���Nonet���_indext���_opent���IOErrort���_chmodt���closet���_update(���t���selft���filebasenamet���modet���flagt���f(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���__init__0���s���� c���������C���s����i��|��_��y�t�|��j���}�Wn�t�k �r<�|��j�|��_�nV�Xt�|��_�|��D�x<�|�D]4�}�|�j����}�t�j �|���\�}�}�|�|��j��|�<qT�WWd��QXd��S(���N( ���R���R���R���R���R���t ���_modifiedt���Falset���rstript���_astt���literal_eval(���R���R���t���linet���keyt���pos_and_siz_pair(����(����s���/usr/lib64/python2.7/dumbdbm.pyR���P���s���� c������ ���C���s����|��j��d��k�s�|��j�r�d��Sy�|��j�j�|��j���Wn�|��j�j�k �rM�n�Xy�|��j�j�|��j�|��j���Wn�|��j�j�k �r��n�X|��j �|��j�d����N�}�|��j �|��j���x4�|��j��j����D]#�\�}�}�|�j�d�|�|�f���q��WWd��QXd��S(���NR���s���%r, %r ( ���R���R���R���R ���t���unlinkR ���t���errort���renameR���R���R���t ���iteritemst���write(���R���R���R!���R"���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���_commita���s����c���������C���sN���|��j��|�\�}�}�t�|��j�d����#�}�|�j�|���|�j�|���}�Wd��QX|�S(���Nt���rb(���R���R���R���t���seekt���read(���R���R!���t���post���sizR���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���__getitem__y���s ���� c���������C���s����t��|��j�d����g�}�|�j�d�d���t�|�j������}�|�t�d�t�t�}�|�j�d�|�|���|�}�|�j�|���Wd��QX|�t�|���f�S(���Ns���rb+i����i���i���s����(���R���R���R*���t���intt���tellt ���_BLOCKSIZER'���t���len(���R���t���valR���R,���t���npos(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���_addval����s����c���������C���sE���t��|��j�d����!�}�|�j�|���|�j�|���Wd��QX|�t�|���f�S(���Ns���rb+(���R���R���R*���R'���R2���(���R���R,���R3���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���_setval����s���� c���������C���sS���|�|��j��|�<t�|��j�d����.�}�|��j�|��j���|�j�d�|�|�f���Wd��QXd��S(���Nt���as���%r, %r (���R���R���R���R���R'���(���R���R!���R"���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���_addkey����s���� c���������C���s����t��|���t��d���k�o)�t��|���k�n�s:�t�d���n��t�|��_�|�|��j�k�rn�|��j�|�|��j�|�����n{�|��j�|�\�}�}�|�t�d�t�}�t�|���t�d�t�}�|�|�k�r��|��j �|�|���|��j�|�<n�|��j�|���|��j�|�<d��S(���Nt����s���keys and values must be stringsi���( ���t���typet ���TypeErrort���TrueR���R���R8���R5���R1���R2���R6���(���R���R!���R3���R,���R-���t ���oldblockst ���newblocks(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���__setitem__����s����. c���������C���s!���t��|��_�|��j�|�=|��j����d��S(���N(���R<���R���R���R(���(���R���R!���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���__delitem__����s���� c���������C���s ���|��j��j����S(���N(���R���t���keys(���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyRA�������s����c���������C���s ���|�|��j��k�S(���N(���R���(���R���R!���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���has_key����s����c���������C���s ���|�|��j��k�S(���N(���R���(���R���R!���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���__contains__����s����c���������C���s ���|��j��j����S(���N(���R���t���iterkeys(���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyRD�������s����c���������C���s ���t��|��j���S(���N(���R2���R���(���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���__len__����s����c���������C���s4���z�|��j�����Wd��d��|��_�|��_�|��_�|��_�Xd��S(���N(���R(���R���R���R���R���R ���(���R���(����(����s���/usr/lib64/python2.7/dumbdbm.pyR�������s����c���������C���s/���t��|��j�d���r+�|��j�j�|�|��j���n��d��S(���Nt���chmod(���t���hasattrR ���RF���R���(���R���t���file(����(����s���/usr/lib64/python2.7/dumbdbm.pyR�������s����(���t���__name__t ���__module__R ���R���R���R���R(���t���syncR.���R5���R6���R8���R?���R@���RA���RB���RC���RD���t���__iter__RE���R���t���__del__R���(����(����(����s���/usr/lib64/python2.7/dumbdbm.pyR����#���s*��� i���c���������C���sO���y �t��j�d���}�t��j�|���Wn�t�k �r3�n�X|�|�@}�t�|��|�|���S(���s���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). i����(���R ���t���umaskt���AttributeErrorR����(���RH���R���R���t���um(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���open����s���� (���t���__doc__t���astR���t���osR ���t���__builtin__t���UserDictRQ���R���R1���R���R$���t ���DictMixinR����R���(����(����(����s���/usr/lib64/python2.7/dumbdbm.pyt���<module>���s��� �