/usr/lib64/python3.9/dbm/__pycache__
Edit: /usr/lib64/python3.9/dbm/__pycache__/dumb.cpython-39.opt-1.pyc (7915B)
a
´i- ã @ sV d Z ddlZddlZddlZddlZddgZ dZ
eZG dd„ dej
jƒZdd
d„ZdS )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ÚerrorÚopeni c @ s e Zd ZeZeZd+dd„Zdd„ Zdd„ Zdd „ ZeZ d
d„ Z
dd
„ Zdd„ Zdd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZeZd d!„ Zd"d#„ ZeZd$d%„ Zd&d'„ Zd(d)„ Zd*S ),Ú _DatabaseÚcc C sL || _ |dk| _|d | _|d | _|d | _d | _| |¡ | |¡ d S )NÚrz.dirz.datz.bak)Ú_modeÚ _readonlyÚ_dirfileÚ_datfileÚ_bakfileÚ_indexÚ_createÚ_update)ÚselfZfilebasenameÚmodeÚflag© r ú /usr/lib64/python3.9/dbm/dumb.pyÚ__init__0 s
z_Database.__init__c C s¾ |dkr@| j | j| jfD ]&}zt |¡ W q ty< Y q0 qztj| j ddd�}W nZ ty° |dvrn‚ tj| j ddd��}| | j ¡ W d ƒ n1 s¢0 Y Y n
0 | ¡ d S )NÚnr úLatin-1©Úencoding©r r Úw)
r
r r Ú_osÚremoveÚOSErrorÚ_ior Ú_chmodÚclose)r r ÚfilenameÚfr r r r
I s 0z_Database._createc C s¢ d| _ i | _ztj| jddd�}W n" tyD |dvr:‚ d| _ Y nZ0 |�D |D ].}| ¡ }t |¡\}}| d¡}|| j|<