o
    $¼"bQ  ã                   @   s|   d Z ddlmZmZ ddlmZmZ ddlmZ ddl	Z	ddl
mZ e	 e¡G dd„ deƒƒZe	 e¡G d	d
„ d
eƒƒZdS )z(
Application data stored by virtualenv.
é    )Úabsolute_importÚunicode_literals)ÚABCMetaÚabstractmethod)ÚcontextmanagerN)Ú	IS_ZIPAPPc                   @   sª   e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZedd	„ ƒZe	d
d„ ƒZ
edd„ ƒZe	dd„ ƒZe	dd„ ƒZedd„ ƒZeddd„ƒZeedd„ ƒƒZeedd„ ƒƒZdS )ÚAppDataz9Abstract storage interface for the virtualenv applicationc                 C   ó   dS )zcalled before virtualenv exitsN© ©Úselfr
   r
   ú:/usr/lib/python3/dist-packages/virtualenv/app_data/base.pyÚclose   ó    zAppData.closec                 C   r	   )z1called when the user passes in the reset app dataNr
   r   r
   r
   r   Úreset   r   zAppData.resetc                 C   ó   t ‚©N©ÚNotImplementedError©r   Úpathr
   r
   r   Úpy_info   ó   zAppData.py_infoc                 C   r   r   r   r   r
   r
   r   Úpy_info_clear   r   zAppData.py_info_clearc                 C   r   r   r   r   r
   r
   r   Ú
can_update"   r   zAppData.can_updatec                 C   r   r   r   )r   ÚdistributionÚfor_py_versionr
   r
   r   Úembed_update_log&   r   zAppData.embed_update_logc                 C   r   r   r   r   r
   r
   r   Úhouse*   r   zAppData.housec                 C   r   r   r   r   r
   r
   r   Ú	transient.   r   zAppData.transientc                 C   r   r   r   )r   r   Únamer
   r
   r   Úwheel_image2   r   zAppData.wheel_imageNc                 c   sH   � t r|  ||¡�}|V  W d  ƒ dS 1 sw   Y  dS |V  dS )zHSome paths might be within the zipapp, unzip these to a path on the diskN)r   Úextract)r   r   Ú	to_folderÚresultr
   r
   r   Úensure_extracted6   s   €"ÿ
zAppData.ensure_extractedc                 C   r   r   r   )r   r   r#   r
   r
   r   r"   ?   ó   zAppData.extractc                 C   r   r   r   r   r
   r
   r   ÚlockedD   r&   zAppData.lockedr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   Úpropertyr   r   r   r   r!   r   r%   r"   r'   r
   r
   r
   r   r      s8    








r   c                   @   sL   e Zd Zedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZeed	d
„ ƒƒZ	dS )ÚContentStorec                 C   r   r   r   r   r
   r
   r   ÚexistsL   r   zContentStore.existsc                 C   r   r   r   r   r
   r
   r   ÚreadP   r   zContentStore.readc                 C   r   r   r   )r   Úcontentr
   r
   r   ÚwriteT   r   zContentStore.writec                 C   r   r   r   r   r
   r
   r   ÚremoveX   r   zContentStore.removec                 C   s   d S r   r
   r   r
   r
   r   r'   \   r&   zContentStore.lockedN)
r(   r)   r*   r   r.   r/   r1   r2   r   r'   r
   r
   r
   r   r-   J   s    



r-   )r+   Ú
__future__r   r   Úabcr   r   Ú
contextlibr   ÚsixÚvirtualenv.infor   Úadd_metaclassÚobjectr   r-   r
   r
   r
   r   Ú<module>   s    ;