https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/__pycache__/storage_uri.cpython-310.pyc
o

ckF[O��@sxddlZddlZddlZddlZddlmZddlmZddlmZGdd�de	�Z
Gdd�de
�ZGd	d
�d
e
�ZdS)�N)�DeleteMarker��BotoClientError)�InvalidUriErrorc@s�eZdZdZdZdZiZdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
d.dd�Zdd�Z		d/dd�Z		d0dd�Zd1dd�Zd2dd�Zd1dd �Zd2d!d"�Zd.d#d$�Z	%			d3d&d'�Z		d4d(d)�Zd*d+�Zd,d-�ZdS)5�
StorageUriz�
    Base class for representing storage provider-independent bucket and
    object name with a shorthand URI-like syntax.

    This is an abstract class: the constructor cannot be called (throws an
    exception if you try).
    NcCstd��)zBUncallable constructor on abstract base StorageUri class.
        z0Attempt to instantiate abstract StorageUri classr��self�r	�2/usr/lib/python3/dist-packages/boto/storage_uri.py�__init__6szStorageUri.__init__cCs|jS)z%Returns string representation of URI.��urirr	r	r
�__repr__<szStorageUri.__repr__cCs|j|jkS)z#Returns true if two URIs are equal.r)rr
r	r	r
�equals@�zStorageUri.equalscCs*|durtd�t�d||fd����dS)N�
z�Attempt to get %s for "%s" failed. This can happen if the URI refers to a non-existent object or if you meant to operate on a directory (e.g., leaving off -R option on gsutil cp, mv, or ls of a bucket)�P)r�join�textwrap�wrap)r�resp�levelr
r	r	r
�check_responseDs
���zStorageUri.check_responsecC�.tt|�t�r|jstd||jf��dSdS)Nz%s on bucket-less URI (%s))�
issubclass�type�BucketStorageUri�bucket_namerr
�r�
function_namer	r	r
�_check_bucket_uriLs
��zStorageUri._check_bucket_uricCr)Nz%s on object-less URI (%s))rrr�object_namerr
rr	r	r
�_check_object_uriQs
��zStorageUri._check_object_uric	Ks4|D]}||rtj�d||t||�f�qdS)Nz$Warning: %s ignores argument: %s=%s
)�sys�stderr�write�str)rr�args�argr	r	r
�_warn_about_argsVs����zStorageUri._warn_about_argsc	Ks t|jpd�}t|d�rd|vr|j|d<|�|�|js�|j|jvr+|j|j|_n]|jdkrHddlm	}|||fi|��|_|j|j|j<n@|jdkrpddl
m}ddlm}|�|d	<|||fi|��|_|j|j|j<n|jd
kr�ddl
m}||�|_ntd|j��|j|j_|jS)
a�
        Opens a connection to appropriate provider, depending on provider
        portion of URI. Requires Credentials defined in boto config file (see
        boto/pyami/config.py).
        @type storage_uri: StorageUri
        @param storage_uri: StorageUri specifying a bucket or a bucket+object
        @rtype: L{AWSAuthConnection<boto.gs.connection.AWSAuthConnection>}
        @return: A connection to storage service provider of the given URI.
        r	�suppress_consec_slashes�s3r)�S3Connection�gs)�GSConnection)�OrdinaryCallingFormat�calling_format�file)�FileConnectionzUnrecognized scheme "%s")�dict�connection_args�hasattrr*�update�
connection�scheme�
provider_pool�boto.s3.connectionr,�boto.gs.connectionr.r/�boto.file.connectionr2r�debug)	r�
access_key_id�secret_access_key�kwargsr4r,r.r/r2r	r	r
�connect]sF

�

��

��
�
zStorageUri.connectcCs"tt|�t�o|jdup|jduS�N)rrr�
version_id�
generationrr	r	r
�has_version�s
�zStorageUri.has_versionFcCs(|�d�|�||�}|�|j|||�S)N�
delete_key)r"�
get_bucketrFr!�r�validate�headersrC�	mfa_token�bucketr	r	r
rF��

�zStorageUri.delete_key�cCsD|�d�|j|d�}|rdd�|j|||d�D�S|j|||d�S)N�list_bucket�rJcss�|]
}t|t�s|VqdSrB)�
isinstancer)�.0�vr	r	r
�	<genexpr>�s��z)StorageUri.list_bucket.<locals>.<genexpr>)�prefix�	delimiterrJ)r rG�
list_versions�list)rrUrVrJ�all_versionsrLr	r	r
rO�s


��zStorageUri.list_bucketcCs|�||�}|�|�SrB)rG�get_all_keys)rrIrJrUrLr	r	r
rZ�s
zStorageUri.get_all_keyscCs6|�d�|��}|�|j||�}|�|d|j�|S)NrGrL)r rArGrrr
)rrIrJ�connrLr	r	r
rG�s

zStorageUri.get_bucketcCs:|�d�|�||�}|�|j||�}|�|d|j�|S)N�get_key�key)r"rGr\r!rr
�rrIrJrCrLr]r	r	r
r\�s

zStorageUri.get_keycCs"|�d�|�||�}|�|j�S)N�new_key)r"rGr_r!�rrIrJrLr	r	r
r_��
zStorageUri.new_keycCsD|�d�|jddd�|�d|�}|�|d|j�|j|||d�S)Nr\F)rIr]�rC)r"r)r\rr
�get_contents_to_file)r�fprJrCr]r	r	r
�get_contents_to_stream�s

z!StorageUri.get_contents_to_stream�
c
Csf|�d�|�d|�}
|�|
d|j�|	r%|
j|||||||||	d�	dS|
�||||||||�dS)Nrcr])�	hash_algs)r"r\rr
rc)rrdrJ�cb�num_cb�torrentrC�res_download_handler�response_headersrgr]r	r	r
rc�s

��zStorageUri.get_contents_to_filecCs8|�d�|�||�}|�|d|j�|�|||||�S)N�get_contents_as_stringr])r"r\rr
rm)rrIrJrhrirjrCr]r	r	r
rm�s
�z!StorageUri.get_contents_as_stringcC�$|��}|jj}|�|d|j�|S)N�	acl_class)rA�providerrorr
)rr[ror	r	r
ro��zStorageUri.acl_classcCrn)N�canned_acls)rArprrrr
)rr[rrr	r	r
rr�rqzStorageUri.canned_acls�NN�FNNN)rNrNNF�FNN�FN)NNrfFNNNN)FNNrfFN)�__name__�
__module__�__qualname__�__doc__r7r4r9rrrrr r"r)rArErFrOrZrGr\r_rercrmrorrr	r	r	r
r sF
:
�
�





�
�rc@s�eZdZdZdZeg�Z			d�dd�Zd	d
�Zdd�Z	d
d�Z
d�dd�Z		d�dd�Zdd�Z
dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd �Zd�d!d"�Zd�d#d$�Z		d�d%d&�Z		d�d'd(�Z		d�d)d*�Z		d�d+d,�Zd�d-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$		d�dDdE�Z%d�dFdG�Z&d�dHdI�Z'dJdK�Z(		d�dLdM�Z)		d�dNdO�Z*d�dPdQ�Z+		d�dRdS�Z,		d�dTdU�Z-		d�dVdW�Z.		d�dXdY�Z/			d�d[d\�Z0			d�d]d^�Z1		d�d_d`�Z2		a		d�dbdc�Z3		d�ddde�Z4d�dfdg�Z5d�dhdi�Z6		d�djdk�Z7d�dldm�Z8d�dndo�Z9d�dpdq�Z:	d�drds�Z;d�dtdu�Z<d�dvdw�Z=		d�dxdy�Z>d�dzd{�Z?		d�d|d}�Z@d�d~d�ZA		d�d�d��ZBd�d�d��ZCdS)�rz�
    StorageUri subclass that handles bucket storage providers.
    Callers should instantiate this class by calling boto.storage_uri().
    �/NrTFc

Csb||_||_||_||_|r||_||_||_|ot|�|_|	|_	t
|j�p)t
|�|_|��dS)a�Instantiate a BucketStorageUri from scheme,bucket,object tuple.

        @type scheme: string
        @param scheme: URI scheme naming the storage provider (gs, s3, etc.)
        @type bucket_name: string
        @param bucket_name: bucket name
        @type object_name: string
        @param object_name: object name, excluding generation/version.
        @type debug: int
        @param debug: debug level to pass in to connection (range 0..2)
        @type connection_args: map
        @param connection_args: optional map containing args to be
            passed to {S3,GS}Connection constructor (e.g., to override
            https_connection_factory).
        @param suppress_consec_slashes: If provided, controls whether
            consecutive slashes will be suppressed in key paths.
        @param version_id: Object version id (S3-specific).
        @param generation: Object generation number (GCS-specific).
        @param is_latest: boolean indicating that a versioned object is the
            current version

        After instantiation the components are available in the following
        fields: scheme, bucket_name, object_name, version_id, generation,
        is_latest, versionless_uri, version_specific_uri, uri.
        Note: If instantiated without version info, the string representation
        for a URI stays versionless; similarly, if instantiated with version
        info, the string representation for a URI stays version-specific. If you
        call one of the uri.set_contents_from_xyz() methods, a specific object
        version will be created, and its version-specific URI string can be
        retrieved from version_specific_uri even if the URI was instantiated
        without version info.
        N)
r8rr!r=r4r*rC�intrD�	is_latest�bool�is_version_specific�_build_uri_strings)
rr8rr!r=r4r*rCrDr}r	r	r
r�s$zBucketStorageUri.__init__cCs�|jr9|jr9d|j|j|jf|_|jrd|j|jf|_n|jr*d|j|jf|_|jr3|j|_dS|j|_dS|jrGd|j|jf|_dSd|j|_dS)Nz
%s://%s/%sz%s#%sz%s://%s/z%s://)	rr!r8�versionless_urirD�version_specific_urirCrr
rr	r	r
r�-s$
�
��z#BucketStorageUri._build_uri_stringsc	Cs4|�t|dd�t|dd�t|dd�t|dd��dS)NrCrDr}�md5)�_update_from_values�getattr)rr]r	r	r
�_update_from_key@s



�z!BucketStorageUri._update_from_keycCs$||_||_||_|��||_dSrB)rCrDr}r�r�)rrCrDr}r�r	r	r
r�Gs

z$BucketStorageUri._update_from_valuescCst|�d�|�||�}|��jdkr|j|j||p|jd�}n|��jdkr0|j|j||jd�}|�|d|j	�|S)Nr\�awsrb�google�rDr])
r"rG�get_provider�namer\r!rCrDrr
r^r	r	r
r\Ns

�
�zBucketStorageUri.get_keycCsf|�d�|�||�}|��jdkr |p|j}|�|j|||�S|��jdkr1|j|j||jd�SdS)NrFr�r�r�)r"rGr�r�rCrFr!rDrHr	r	r
rFZs

�
��zBucketStorageUri.delete_keycCs$|�d�t|j|j||j|jd�S)z�Instantiate a BucketStorageUri from the current BucketStorageUri,
        but replacing the object_name.

        @type new_name: string
        @param new_name: new object name
        �clone_replace_name)rr!r=r*)r rr8rr=r*�r�new_namer	r	r
r�fs

�z#BucketStorageUri.clone_replace_namec
Csn|�d�d}d}d}t|d�r|j}t|d�r|j}t|d�r#|j}t|j��|jj	|j	|j
|j|||d�S)a)Instantiate a BucketStorageUri from the current BucketStorageUri, by
        replacing the object name with the object name and other metadata found
        in the given Key object (including generation).

        @type key: Key
        @param key: key for the new StorageUri to represent
        �clone_replace_keyNFrCrDr})rr!r=r*rCrDr})r r5rCrDr}rrp�get_provider_namerLr�r=r*)rr]rCrDr}r	r	r
r�ss(



�z"BucketStorageUri.clone_replace_keycCsn|�d�|�||�}|jpd}|��jdkr$|p|j}|�|||�}n	|j|||jd�}|�|d|j	�|S)zreturns a bucket's acl�get_aclrNr�r��acl)
r rGr!r�r�rCr�rDrr
)rrIrJrCrL�key_namer�r	r	r
r��s


zBucketStorageUri.get_aclcC�4|�d�|�||�}|�|�}|�|d|j�|S)z%returns a bucket's default object acl�get_def_aclr�)r rGr�rr
)rrIrJrLr�r	r	r
r���


zBucketStorageUri.get_def_aclcCr�)zreturns a bucket's CORS XML�get_cors�cors)r rGr�rr
)rrIrJrLr�r	r	r
r��r�zBucketStorageUri.get_corscCsD|�d�|�||�}|jdkr|�||�dS|�|��|�dS)z#sets or updates a bucket's CORS XMLz	set_cors r+N)r rGr8�set_cors�to_xml)rr�rIrJrLr	r	r
r��s


zBucketStorageUri.set_corscC� |�d�|�||�}|�|�S)N�get_location)r rGr�r`r	r	r
r���

zBucketStorageUri.get_locationcCs8|�d�|jdkrtd|j��|�||�}|�|�S)N�get_storage_classr-z.get_storage_class() not supported for %s URIs.)r r8�
ValueErrorrGr�r`r	r	r
r��s

�
z"BucketStorageUri.get_storage_classcCs>|�d�|jdkrtd|j��|�||�}|�||�dS)z!Updates a bucket's storage class.�set_storage_classr-z.set_storage_class() not supported for %s URIs.N)r r8r�rGr�)r�
storage_classrIrJrLr	r	r
r��s

�z"BucketStorageUri.set_storage_classcCs(|�d�|�||�}|�||j||�S)N�get_subresource)r rGr�r!)r�subresourcerIrJrCrLr	r	r
r��rMz BucketStorageUri.get_subresourcecCs�|�d�|jdkrtd|j��|jr1|rtd��|�||�}|�|d|j�|�|||�dS|jrD|�	||�}|�||||�dSt
d|j��)N�add_group_email_grantr-z2add_group_email_grant() not supported for %s URIs.zDadd_group_email_grant() on key-ful URI cannot specify recursive=Truer]z-add_group_email_grant() on bucket-less URI %s)r r8r�r!r\rr
r�rrGr)r�
permission�
email_address�	recursiverIrJr]rLr	r	r
r��s&

�
��z&BucketStorageUri.add_group_email_grantcC�\|�d�|js|�||�}|�||||�dS|�||�}|�|d|j�|�||�dS)N�add_email_grantr])r r!rGr�r\rr
)rr�r�r�rIrJrLr]r	r	r
r��s

�z BucketStorageUri.add_email_grantcCr�)N�add_user_grantr])r r!rGr�r\rr
)rr��user_idr�rIrJrLr]r	r	r
r��s
zBucketStorageUri.add_user_grantcCs|�d�|�|�}|�|�S)Nzlist_grants )r rG�list_grants�rrJrLr	r	r
r�s


zBucketStorageUri.list_grantscC�dS)�3Returns True if this URI names a file or directory.Fr	rr	r	r
�is_file_uri
�zBucketStorageUri.is_file_uricCr�)�2Returns True if this URI names a bucket or object.Tr	rr	r	r
�is_cloud_urir�zBucketStorageUri.is_cloud_uricC�t|j�S)z�
        Returns True if this URI names a directory or bucket. Will return
        False for bucket subdirs; providing bucket subdir semantics needs to
        be done by the caller (like gsutil does).
        �r~r!rr	r	r
�names_containersz BucketStorageUri.names_containercC�
t|j�S)z0Returns True if this URI names a file or object.r�rr	r	r
�names_singleton�
z BucketStorageUri.names_singletoncCr��z+Returns True if this URI names a directory.Fr	rr	r	r
�names_directoryr�z BucketStorageUri.names_directorycCr�)�*Returns True if this URI names a provider.)r~rrr	r	r
�names_provider"rzBucketStorageUri.names_providercCst|j�o
t|j�S)�(Returns True if this URI names a bucket.)r~rr!rr	r	r
�names_bucket&szBucketStorageUri.names_bucketcCr�)�&Returns True if this URI names a file.Fr	rr	r	r
�
names_file*r�zBucketStorageUri.names_filecC�|��S)�)Returns True if this URI names an object.�r�rr	r	r
�names_object.�zBucketStorageUri.names_objectcCr�)z8Returns True if this URI represents input/output stream.Fr	rr	r	r
�	is_stream2r�zBucketStorageUri.is_streamrNcCsB|�d�|��}|jdkr|�|j||||�S|�|j|||�S)Nzcreate_bucket r-)r rAr8�
create_bucketr)rrJ�location�policyr�r[r	r	r
r�6s

�zBucketStorageUri.create_bucketcCs |�d�|��}|�|j|�S)N�
delete_bucket)r rAr�r�rrJr[r	r	r
r�Bs
zBucketStorageUri.delete_bucketcCs|��}|�|�SrB)rA�get_all_bucketsr�r	r	r
r�Gs
z BucketStorageUri.get_all_bucketscCs"|��}|j}|�|d|j�|S)Nrp)rArprr
)rr[rpr	r	r
r�KszBucketStorageUri.get_providerc	Csd|�d�|p|jpd}|�||�}|jr#|j||||j||d�dS|p'|j}|�||||�dS)zSets or updates a bucket's ACL.�set_aclrN�rD�
if_generation�if_metagenerationN)r r!rGrDr�rC)	r�
acl_or_strr�rIrJrCr�r�rLr	r	r
r�Qs


�
zBucketStorageUri.set_aclc	Csf|�d�|p|jpd}|�||�}|jr#|j||||j||d�dS|p'|j}|j||||d�dS)z2Sets or updates a bucket's ACL with an XML string.�set_xml_aclrNr�rbN)r r!rGrDr�rC)	r�	xmlstringr�rIrJrCr�r�rLr	r	r
r�_s


�


�zBucketStorageUri.set_xml_aclcC�"|�d�|�||��||�dS)zASets or updates a bucket's default object ACL with an XML string.�set_def_xml_aclN)r rGr�)rr�rIrJr	r	r
r�ns
z BucketStorageUri.set_def_xml_aclcCr�)z.Sets or updates a bucket's default object ACL.�set_def_aclN)r rGr�)rr�rIrJrCr	r	r
r�ss
zBucketStorageUri.set_def_aclcCsD|�d�|jd|d�|�||�}|�|d|j�|�||�dS)z>Sets or updates a bucket's acl to a predefined (canned) value.�set_canned_aclrbr]N)r"r)r\rr
r��r�acl_strrIrJrCr]r	r	r
r�ys

zBucketStorageUri.set_canned_aclcCs8|�d�|�||�}|�|d|j�|�|||�dS)zXSets or updates a bucket's default object acl to a predefined
           (canned) value.zset_def_canned_acl r]N)r r\rr
�set_def_canned_aclr�r	r	r
r��s
z#BucketStorageUri.set_def_canned_aclcCs.|�d�|�||�}|�|||j||�dS)N�set_subresource)r rGr�r!)rr��valuerIrJrCrLr	r	r
r��s

�z BucketStorageUri.set_subresourcerfc	
Csn|�d�|j|d�}	|jdkr$|rtj�d�|	�|||||||�}
n|	�||||||||�}
|�|	�|
S)N�set_contents_from_stringrPr-z^Warning: GCS does not support reduced_redundancy; argument ignored by set_contents_from_string)r"r_r8r#r$r%r�r�)r�srJ�replacerhrir�r��reduced_redundancyr]�resultr	r	r
r��s

��
z)BucketStorageUri.set_contents_from_stringc
Cs�|�d�|j|d�}|jdkr+|j|||||||||	|
d�
}|
r*|�d|
jd|�n|jd|
d�|j|||||||||	d�	}|�|�|S)N�set_contents_from_filerPr-)�size�rewind�res_upload_handler)r�)r�r�)r"r_r8r�r�rDr)r�)
rrdrJr�rhrir�r�r�r�r�r]r�r	r	r
r��s*

�
����
z'BucketStorageUri.set_contents_from_filec	Cs:|�d�|�d|�}|j||||||d�}|�|�|S)N�set_contents_from_streamF)r�r�)r"r_r�r�)	rrdrJr�rhr�r��dst_keyr�r	r	r
r��s

�
z)BucketStorageUri.set_contents_from_stream�STANDARDcCs\|�d�|jd|d�}|
r|j|j||||||||	|
d�
S|j|j|||||||||	d�
S)zReturns newly created key.�copy_keyF)rIrJ)
�new_key_name�src_bucket_name�src_key_name�metadatar��preserve_acl�encrypt_keyrJ�
query_args�src_generation)
r�r�r�r��src_version_idr�r�r�rJr�)r"rGr�r!)rr�r�r�r�r�r�r�rJr�r��
dst_bucketr	r	r
r��s$
��zBucketStorageUri.copy_keycCs*|�d�|�||�}|j|||d�dS)N�enable_loggingrP)r rGr�)r�
target_bucket�
target_prefixrIrJrCrLr	r	r
r��s
zBucketStorageUri.enable_loggingcCs&|�d�|�||�}|j|d�dS)N�disable_loggingrP)r rGr��rrIrJrCrLr	r	r
r��s
z BucketStorageUri.disable_loggingcCs"|�d�|�||�}|j|d�S)N�get_logging_configrP)r rGr�r�r	r	r
r��raz#BucketStorageUri.get_logging_configcCs>|�d�|�||�}|s|s|�|�dS|�|||�dS)N�set_website_config)r rG�delete_website_configuration�configure_website)r�main_page_suffix�	error_keyrIrJrLr	r	r
r��s

z#BucketStorageUri.set_website_configcCr�)N�get_website_config)r rG�get_website_configurationr`r	r	r
r�r�z#BucketStorageUri.get_website_configcCs |�d�|�d|�}|�|�S)N�get_versioning_configF)r rG�get_versioning_statusr�r	r	r
r�r�z&BucketStorageUri.get_versioning_configcCs"|�d�|�d|�}|�||�S)N�configure_versioningF)r rGr)r�enabledrJrLr	r	r
r�raz%BucketStorageUri.configure_versioningcCs|�d�j||||d�S)NFrP)r\�set_remote_metadata)r�
metadata_plus�metadata_minusr�rJr	r	r
�set_metadatas
�zBucketStorageUri.set_metadatacCsT|�d�g}|D]}|�|���|j|d_q	|��j|||d�|_|��|S)N�compose���)�content_typerJ)r"�appendr_rDr
r�)r�
componentsrrJ�component_keys�surir	r	r
r

s
�zBucketStorageUri.composecCr�)z+Returns a bucket's lifecycle configuration.�get_lifecycle_config�	lifecycle)r rGrrr
)rrIrJrL�lifecycle_configr	r	r
rr�z%BucketStorageUri.get_lifecycle_configcCs&|�d�|�||�}|�||�dS)z3Sets or updates a bucket's lifecycle configuration.�configure_lifecycleN)r rGr)rrrIrJrLr	r	r
rs
z$BucketStorageUri.configure_lifecyclecCs8|�d�|jdkrtd|j��|�d|�}|�|�S)N�get_billing_configr-z/get_billing_config() not supported for %s URIs.F)r r8r�rGrr�r	r	r
r$s

�
z#BucketStorageUri.get_billing_configcCs@|�d�|jdkrtd|j��|�||�}|j||d�dS)z1Sets or updates a bucket's billing configuration.�configure_billingr-z.configure_billing() not supported for %s URIs.)�requester_paysrJN)r r8r�rGr)rrrIrJrLr	r	r
r-s

�z"BucketStorageUri.configure_billingcCs:|�d�|jdkrtd|j��|�||�}|j|d�S)z0Returns a GCS bucket's encryption configuration.�get_encryption_configr-z2get_encryption_config() not supported for %s URIs.rP)r r8r�rGrr`r	r	r
r8s

�z&BucketStorageUri.get_encryption_configcCs(|�d�|�||�}|j||d�dS)z-Sets a GCS bucket's encryption configuration.�set_encryption_config)�default_kms_key_namerJN)r rGr)rrrIrJrLr	r	r
rCs


�z&BucketStorageUri.set_encryption_configcCs6|js
td|j��|�|�}|j|j|d�}t|�S)z8Returns True if the object exists or False if it doesn'tzexists on object-less URI (%s)rP)r!rr
rGr\r~)rrJrLr]r	r	r
�existsKs

zBucketStorageUri.exists)NNrNTNNFrurtrv)FFNrB)NrNNN)rNFNNNN)NTNrfNNF)	NTNrfNNNFN)NTNNF)NNr�FFNNN)NFNN)NNFNrs)NFN)Drwrxryrz�delim�set�capabilitiesrr�r�r�r\rFr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr	r
rrrrrrrr	r	r	r
r�s�
�1

�




	



�
�
�
�

�


�
�

�
�	
�	
�
�
�
�

�
�


�
	


�


�
	
�

�rc@s�eZdZdZejZd dd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd!dd�ZdS)"�FileStorageUriz�
    StorageUri subclass that handles files in the local file system.
    Callers should instantiate this class by calling boto.storage_uri().

    See file/README about how we map StorageUri operations onto a file system.
    FcCs,d|_d|_||_d||_||_||_dS)a�Instantiate a FileStorageUri from a path name.

        @type object_name: string
        @param object_name: object name
        @type debug: boolean
        @param debug: whether to enable debugging on this StorageUri

        After instantiation the components are available in the following
        fields: uri, scheme, bucket_name (always blank for this "anonymous"
        bucket), object_name.
        r1rNzfile://N)r8rr!r
r=�stream)rr!r=r�r	r	r
r^s


zFileStorageUri.__init__cCst||j|j�S)z�Instantiate a FileStorageUri from the current FileStorageUri,
        but replacing the object_name.

        @type new_name: string
        @param new_name: new object name
        )rr=r r�r	r	r
r�rsz!FileStorageUri.clone_replace_namecCr�)r�Tr	rr	r	r
r�{r�zFileStorageUri.is_file_uricCr�)r�Fr	rr	r	r
r�r�zFileStorageUri.is_cloud_uricCr�)z5Returns True if this URI names a directory or bucket.)r�rr	r	r
r��r�zFileStorageUri.names_containercCs
|��S)z<Returns True if this URI names a file (or stream) or object.)r�rr	r	r
r��r�zFileStorageUri.names_singletoncCs|jrdStj�|j�Sr�)r �os�path�isdirr!rr	r	r
r��szFileStorageUri.names_directorycCr�)r�Fr	rr	r	r
r��r�zFileStorageUri.names_providercCr�)r�Fr	rr	r	r
r��r�zFileStorageUri.names_bucketcCr�)r�r�rr	r	r
r��r�zFileStorageUri.names_filecCr�)r�Fr	rr	r	r
r��r�zFileStorageUri.names_objectcCr�)zAReturns True if this URI represents input/output stream.
        )r~r rr	r	r
r��s
zFileStorageUri.is_streamcCs|����dS)z$Closes the underlying file.
        N)r\�closerr	r	r
r$�szFileStorageUri.closeNcCstj�|j�S)z6Returns True if the file exists or False if it doesn't)r!r"rr!)r�_headers_not_usedr	r	r
r�szFileStorageUri.exists)FrB)rwrxryrzr!�seprrr�r�r�r�r�r�r�r�r�r�r�r$rr	r	r	r
rTs"
	r)
�botor!r#r�boto.s3.deletemarkerr�boto.exceptionrr�objectrrrr	r	r	r
�<module>sTe

https://t.me/RX1948 - 2025