
    i	                         d dl Z d dlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ  e       Z	  G d	 d
e	      Zej                  e_         G d de      Zde_        de_        ee_        ee_        y)    N)AnyOptional   )CloudImplementation)MissingCredentialsError   )LocalClient)	LocalPathc                   &     e Zd ZdZeZ fdZ xZS )LocalAzureBlobClientzReplacement for AzureBlobClient that uses the local file system. Intended as a monkeypatch
    substitute when writing tests.
    c                     |j                  dd       |j                  dd       |j                  dd       t        j                  dd       g}t        |   |i | t        d |D              rt        d      y )Nblob_service_clientconnection_stringaccount_urlAZURE_STORAGE_CONNECTION_STRINGc              3   $   K   | ]  }|d u  
 y wN ).0opts     y/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/cloudpathlib/local/implementations/azure.py	<genexpr>z0LocalAzureBlobClient.__init__.<locals>.<genexpr>   s     0ssd{0s   ziAzureBlobClient does not support anonymous instantiation. Credentials are required; see docs for options.)getosgetenvsuper__init__allr   )selfargskwargs	cred_opts	__class__s       r   r   zLocalAzureBlobClient.__init__   s    JJ,d3JJ*D1JJ}d+II7>	
	 	$)&)0i00)B  1    )__name__
__module____qualname____doc__local_azure_blob_implementation_cloud_metar   __classcell__)r#   s   @r   r   r      s     2K r$   r   c                       e Zd ZU dZdZeed<   eZe	defd       Z
ddee   fdZe	defd	       Ze	defd
       Ze	d        Ze	defd       Zy)LocalAzureBlobPathzReplacement for AzureBlobPath that uses the local file system. Intended as a monkeypatch
    substitute when writing tests.
    zaz://cloud_prefixreturnc                     | j                   S r   )	containerr   s    r   drivezLocalAzureBlobPath.drive1   s    ~~r$   Nmodec                      y r   r   )r   parentsexist_okr4   s       r   mkdirzLocalAzureBlobPath.mkdir5   s    r$   c                 @    | j                   j                  dd      d   S )N/   r   )
_no_prefixsplitr2   s    r   r1   zLocalAzureBlobPath.container9   s    $$S!,Q//r$   c                 J    | j                   }|j                  d      r|dd  }|S )Nr:   r;   )_no_prefix_no_drive
startswith)r   keys     r   blobzLocalAzureBlobPath.blob=   s+    && >>#ab'C
r$   c                 8    | j                   j                  |       S r   client_md5r2   s    r   etagzLocalAzureBlobPath.etagG       {{%%r$   c                 8    | j                   j                  |       S r   rD   r2   s    r   md5zLocalAzureBlobPath.md5K   rH   r$   )FFN)r%   r&   r'   r(   r.   str__annotations__r)   r*   propertyr3   r   r   r8   r1   rB   rG   rJ   r   r$   r   r-   r-   )   s      L#1Ks  #  03 0 0 c   & & &S & &r$   r-   AzureBlobPathazure)r   typingr   r   	cloudpathr   
exceptionsr   localclientr	   	localpathr
   r)   r   	CloudPathrN   r-   r%   name_client_class_path_classr   r$   r   <module>rY      sw    	   , 1 % ! #6"7 (; . &:%C%C  "$& $&N .  '.  $0D  -.@  +r$   