ó
    ëBj°  ã                   ó’   • S SK r S SKJr  S SKJr  S SKJrJrJr  SSK	J
r
JrJr  \(       a  SSKJr  \" S	5       " S
 S\
5      5       rg)é    N)ÚPath)ÚTemporaryDirectory)ÚAnyÚTYPE_CHECKINGÚOptionalé   )Ú	CloudPathÚNoStatErrorÚregister_path_classé   )ÚGSClientÚgsc                   óæ   • \ rS rSr% SrSr\\S'   S\S'   \S\4S j5       r	SS
\
\   4S jjrSS\S
\
\   4S jjrSS jr\S\4S j5       r\S\4S j5       r\S 5       r\S\
\   4S j5       rSrg	)ÚGSPathé   a  Class for representing and operating on Google Cloud Storage URIs, in the style of the
Python standard library's [`pathlib` module](https://docs.python.org/3/library/pathlib.html).
Instances represent a path in GS with filesystem path semantics, and convenient methods allow
for basic operations like joining, reading, writing, iterating over contents, etc. This class
almost entirely mimics the [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path)
interface, so most familiar properties and methods should be available and behave in the
expected way.

The [`GSClient`](../gsclient/) class handles authentication with GCP. If a client instance is
not explicitly specified on `GSPath` instantiation, a default client is used. See `GSClient`'s
documentation for more details.
zgs://Úcloud_prefixr   ÚclientÚreturnc                 ó   • U R                   $ ©N)Úbucket©Úselfs    ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/cloudpathlib/gs/gspath.pyÚdriveÚGSPath.drive   s   € à�{‰{Ðó    NÚmodec                 ó   • g r   © )r   ÚparentsÚexist_okr   s       r   ÚmkdirÚGSPath.mkdir"   s   € àr   r"   c                 óJ  • U R                  5       (       a1  U(       d  [        SU  35      eU R                  R                  X 5        g [	        5       n[        UR                  5      S-  nUR                  5         U R                  R                  X@5        UR                  5         g )NzFile exists: Úempty)
ÚexistsÚFileExistsErrorr   Ú
_move_filer   r   ÚnameÚtouchÚ_upload_fileÚcleanup)r   r"   r   ÚtfÚps        r   r+   ÚGSPath.touch&   sr   € Ø�;‰;�=‰=ÞÜ%¨°d°VÐ&<Ó=Ð=Ø�K‰K×"Ñ" 4Õ.ä#Ó%ˆBÜ�R—W‘W“ Ñ'ˆAØ�G‰GŒIà�K‰K×$Ñ$ QÔ-à�J‰J�Lr   c                 ó  • U R                   R                  U 5      nUc  [        SU  S35      e US   R                  5       n[
        R                  " S S U R                  S S S UR                  SS5      S US 4
5      $ ! [         a    Sn NHf = f)NzNo stats available for z%; it may be a directory or not exist.Úupdatedr   Úsize)	r   Ú_get_metadatar
   Ú	timestampÚKeyErrorÚosÚstat_resultr   Úget)r   Úfollow_symlinksÚmetaÚmtimes       r   ÚstatÚGSPath.stat4   s©   € Ø�{‰{×(Ñ(¨Ó.ˆØ‰<ÜØ)¨$¨Ð/TÐUóð ð	Ø˜‘O×-Ñ-Ó/ˆEô �~Š~àØØ×!Ñ!ØØØØ—‘˜ Ó#ØØØðó
ð 	
øô ó 	ØŠEð	ús   ¯A< Á<BÂ
Bc                 ó@   • U R                   R                  SS5      S   $ )NÚ/r   r   )Ú
_no_prefixÚsplitr   s    r   r   ÚGSPath.bucketO   s   € à�‰×$Ñ$ S¨!Ó,¨QÑ/Ð/r   c                 óT   • U R                   nUR                  S5      (       a  USS  nU$ )Nr@   r   )Ú_no_prefix_no_driveÚ
startswith)r   Úkeys     r   ÚblobÚGSPath.blobS   s.   € à×&Ñ&ˆð �>‰>˜#×ÑØ�a�b�'ˆCàˆ
r   c                 óV   • U R                   R                  U 5      R                  S5      $ )NÚetag©r   r4   r9   r   s    r   rK   ÚGSPath.etag^   s"   € à�{‰{×(Ñ(¨Ó.×2Ñ2°6Ó:Ð:r   c                 ól   • U R                   R                  U 5      nU(       d  g UR                  SS 5      $ )NÚmd5_hashrL   )r   r;   s     r   Úmd5Ú
GSPath.md5b   s-   € à�{‰{×(Ñ(¨Ó.ˆÞØØ�x‰x˜
 DÓ)Ð)r   r    )FFN)TN)T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚstrÚ__annotations__Úpropertyr   r   r   r#   Úboolr+   r=   r   rH   rK   rP   Ú__static_attributes__r    r   r   r   r      sÇ   ‡ ñð  €L�#ÓØÓàð�só ó ðñ¸À#¹õ ñ˜dð °¸#±õ ô
ð6 ð0˜ó 0ó ð0ð ð�có ó ðð ñ;ó ð;ð ð*�X˜c‘]ó *ó ó*r   r   )r7   Úpathlibr   Útempfiler   Útypingr   r   r   Ú	cloudpathr	   r
   r   Úgsclientr   r   r    r   r   Ú<module>ra      sC   ðÛ 	Ý Ý 'ß /Ñ /ç CÑ CæÝ"ñ �TÓôZ*ˆYó Z*ó ñZ*r   