§
    ÎÑßjv  ã                  ó²   — d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ e	rddlmZ ddlmZ dd	lmZ  G d
„ de¦  «        Z G d„ de¦  «        ZddgZdS )z&Application data stored by virtualenv.é    )Úannotations)ÚABCÚabstractmethod)Úcontextmanager)ÚTYPE_CHECKING)Ú	IS_ZIPAPP)Ú	Generator)ÚPath)ÚAnyc                  óT  — 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 )&ÚAppDataz:Abstract storage interface for the virtualenv application.ÚreturnÚNonec                ó   — dS )zCalled before virtualenv exits.N© ©Úselfs    úL/opt/saltstack/salt/lib/python3.11/site-packages/virtualenv/app_data/base.pyÚclosezAppData.close   ó   € € € ó    c                ó   — dS )z2Called when the user passes in the reset app data.Nr   r   s    r   ÚresetzAppData.reset   r   r   Úpathr
   ÚContentStorec                ó   — t           ‚)zÃReturn a content store for cached interpreter information at the given path.

        :param path: the interpreter executable path

        :returns: a content store for the cached data

        ©ÚNotImplementedError©r   r   s     r   Úpy_infozAppData.py_info   s
   € õ "Ð!r   c                ó   — t           ‚)z)Clear all cached interpreter information.r   r   s    r   Úpy_info_clearzAppData.py_info_clear'   ó
   € õ "Ð!r   Úboolc                ó   — t           ‚)zA``True`` if this app data store supports updating cached content.r   r   s    r   Ú
can_updatezAppData.can_update,   r#   r   ÚdistributionÚstrÚfor_py_versionc                ó   — t           ‚)a   Return a content store for the embed update log of a distribution.

        :param distribution: the package name (e.g. ``pip``)
        :param for_py_version: the target Python version string

        :returns: a content store for the update log

        r   )r   r'   r)   s      r   Úembed_update_logzAppData.embed_update_log1   ó
   € õ "Ð!r   c                ó   — t           ‚)z1The root directory of the application data store.r   r   s    r   ÚhousezAppData.house=   r#   r   c                ó   — t           ‚)zN``True`` if this app data store is transient and does not persist across runs.r   r   s    r   Ú	transientzAppData.transientB   r#   r   Únamec                ó   — t           ‚)zÉReturn the path to a cached wheel image.

        :param for_py_version: the target Python version string
        :param name: the package name

        :returns: the path to the cached wheel

        r   )r   r)   r1   s      r   Úwheel_imagezAppData.wheel_imageG   r,   r   NÚ	to_folderúPath | NoneúGenerator[Path]c              #  óŠ   K  — t           r5|                      ||¦  «        5 }|V — ddd¦  «         dS # 1 swxY w Y   dS |V — dS )zúEnsure a path is available on disk, extracting from zipapp if needed.

        :param path: the path to ensure is available
        :param to_folder: optional target directory for extraction

        :returns: yields the usable path on disk

        N)r   Úextract)r   r   r4   Úresults       r   Úensure_extractedzAppData.ensure_extractedS   s�   è è € õ ð 	Ø—’˜d IÑ.Ô.ð °&Ø���ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð ð ˆJˆJˆJˆJˆJs    2²6¹6c                ó   — t           ‚)zÊExtract a path from the zipapp to a location on disk.

        :param path: the path to extract
        :param to_folder: optional target directory

        :returns: yields the extracted path

        r   )r   r   r4   s      r   r8   zAppData.extractc   s
   € õ "Ð!r   úGenerator[None]c                ó   — t           ‚)z]Acquire an exclusive lock on the given path.

        :param path: the path to lock

        r   r   s     r   ÚlockedzAppData.lockedp   s
   € õ "Ð!r   ©r   r   )r   r
   r   r   ©r   r$   )r'   r(   r)   r(   r   r   )r   r
   )r)   r(   r1   r(   r   r
   )N)r   r
   r4   r5   r   r6   )r   r
   r   r<   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r    r"   Úpropertyr&   r+   r.   r0   r3   r   r:   r8   r>   r   r   r   r   r      sµ  € € € € € ØDÐDàð.ð .ð .ñ „^ð.ð ðAð Að Añ „^ðAð ð"ð "ð "ñ „^ð"ð ð"ð "ð "ñ „^ð"ð ð"ð "ð "ñ „Xð"ð ð	"ð 	"ð 	"ñ „^ð	"ð ð"ð "ð "ñ „Xð"ð ð"ð "ð "ñ „Xð"ð ð	"ð 	"ð 	"ñ „^ð	"ð ðð ð ð ñ „^ðð Øð	"ð 	"ð 	"ñ „^ñ „^ð	"ð Øð"ð "ð "ñ „^ñ „^ð"ð "ð "r   r   c                  óš   — e Zd 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 )r   z/A store for reading and writing cached content.r   r$   c                ó   — t           ‚)z[Check if the stored content exists.

        :returns: ``True`` if content exists

        r   r   s    r   ÚexistszContentStore.exists~   ó
   € õ "Ð!r   r   c                ó   — t           ‚)zHRead the stored content.

        :returns: the stored content

        r   r   s    r   ÚreadzContentStore.read‡   rI   r   Úcontentr   c                ó   — t           ‚)zSWrite content to the store.

        :param content: the content to write

        r   )r   rL   s     r   ÚwritezContentStore.write�   rI   r   c                ó   — t           ‚)zRemove the stored content.r   r   s    r   ÚremovezContentStore.remove™   r#   r   r<   c                ó   — dS )z0Acquire an exclusive lock on this content store.Nr   r   s    r   r>   zContentStore.lockedž   r   r   Nr@   )r   r   )rL   r   r   r   r?   )r   r<   )rA   rB   rC   rD   r   rH   rK   rN   rP   r   r>   r   r   r   r   r   {   sÂ   € € € € € Ø9Ð9àð"ð "ð "ñ „^ð"ð ð"ð "ð "ñ „^ð"ð ð"ð "ð "ñ „^ð"ð ð"ð "ð "ñ „^ð"ð Øð?ð ?ð ?ñ „^ñ „^ð?ð ?ð ?r   r   N)rD   Ú
__future__r   Úabcr   r   Ú
contextlibr   Útypingr   Úvirtualenv.infor   Úcollections.abcr	   Úpathlibr
   r   r   r   Ú__all__r   r   r   ú<module>rZ      s  ðØ ,Ð ,à "Ð "Ð "Ð "Ð "Ð "à #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø %Ð %Ð %Ð %Ð %Ð %Ø  Ð  Ð  Ð  Ð  Ð  à %Ð %Ð %Ð %Ð %Ð %àð Ø)Ð)Ð)Ð)Ð)Ð)ØÐÐÐÐÐØÐÐÐÐÐðg"ð g"ð g"ð g"ð g"ˆcñ g"ô g"ð g"ðT&?ð &?ð &?ð &?ð &?�3ñ &?ô &?ð &?ðT Øð€€€r   