B
    v9a—  ã               @   sÆ   d ddgZ ddlZddlZddlZddlZG dd„ deƒZdddgZdai Z	ee
fZydd	lmZ W n ek
r|   dZY nX ddd „Zdd„ ZedkrÂx(ejdd… D ]Zeeeƒp¸deƒ q¨W dS )ÚopenÚwhichdbÚerroré    Nc               @   s   e Zd ZdS )r   N)Ú__name__Ú
__module__Ú__qualname__© r   r   ú/usr/lib/python3.7/__init__.pyr   &   s   zdbm.gnuzdbm.ndbmzdbm.dumb)ÚndbmÚré¶  c          	   C   sè   t d kr`xFtD ]>}yt|dgd}W n tk
r:   wY nX t sD|a |t|< qW t s`tdt ƒ‚d|krpt| ƒnd }|d kr d|ksŒd|kr’t }qÚtd dƒ‚n:|dkr¶td d	ƒ‚n$|tkrÒtd d
 |¡ƒ‚nt| }| | ||¡S )Nr   )Úfromlistzno dbm clone found; tried %sÚnÚcr   z#need 'c' or 'n' flag to open new dbÚ zdb type could not be determinedz/db type is {0}, but the module is not available)	Ú_defaultmodÚ_namesÚ
__import__ÚImportErrorÚ_modulesr   r   Úformatr   )ÚfileÚflagÚmodeÚnameÚmodÚresultr   r   r	   r   5   s.    


c             C   sä  y4t  | d d¡}| ¡  t  | d d¡}| ¡  dS  tk
r˜   y:t  | d d¡}| ¡  td k	r|t | ¡}| ¡  dS W n tk
r’   Y nX Y nX y`t | d ¡ t | d ¡j}|dkrÆdS t  | d d¡}z| d	¡d
krêdS W d | ¡  X W n tk
r   Y nX yt  | d¡}W n tk
r8   d S X | | d¡}W d Q R X |dd… }t	|ƒdkrrdS yt
 d|¡\}W n t
jk
rœ   dS X |dkr¬dS yt
 d|dd … ¡\}W n t
jk
rÞ   dS X dS )Nz.pagÚrbz.dirzdbm.ndbmz.dbz.datr   zdbm.dumbé   )ó   'ó   "é   é   r   z=l)iÎšWiÍšWiÏšWzdbm.gnuéüÿÿÿ)Úior   ÚcloseÚOSErrorr
   ÚosÚstatÚst_sizeÚreadÚlenÚstructÚunpackr   )ÚfilenameÚfÚdÚsizeZs16ÚsÚmagicr   r   r	   r   a   s`    

Ú__main__r   ZUNKNOWN)r   r   )Ú__all__r$   r'   r,   ÚsysÚ	Exceptionr   r   r   r   r&   Zdbmr
   r   r   r   r   Úargvr.   Úprintr   r   r   r	   Ú<module>   s$   



,Y