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/S3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/S3/__pycache__/S3Uri.cpython-310.pyc
o

�Qa~�@sddlmZmZddlZddlZddlZddlmZmZm	Z	ddl
mZejdkZ
Gdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�Zedkr�ed�Zedee��ede�edej�ede���ede���e�ed�Zedee��ede�edej�ede���e�ed�Zedee��ede�edej�ede���e�ed�Zedee��ede�edej�ede���e�ed�Zedee��ede�edej�ede���e�dSdS)�)�absolute_import�print_functionN�)�	unicodise�deunicodise�check_bucket_name_dns_support)�Config)�rc@sDeZdZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�S3UriNc	Cs�|js1g|_tjtj}|D]"}t||�t|�urqt|||�r0|||kr0|j�||�q|jD]}zt�	|�}|�
|�|WStyNYq4wtd|��)Nz%s: not a recognized URI)�_subclasses�sys�modules�__name__�__dict__�type�
issubclass�append�object�__new__�__init__�
ValueError)�self�string�dict�	something�subclass�instance�r�*/usr/lib/python3/dist-packages/S3/S3Uri.pyrs$�



�z
S3Uri.__new__cCstr|��St|���S�N)�PY3�urir�rrrr�__str__,sz
S3Uri.__str__cCs|��Sr)r!r"rrr�__unicode__2�zS3Uri.__unicode__cCstd|jj|��f�S)Nz<%s: %s>)�repr�	__class__rr$r"rrr�__repr__5�zS3Uri.__repr__cCstd��)Nz6This S3 URI does not have Anonymous URL representation)rr"rrr�
public_url8r%zS3Uri.public_urlcCs|���d�dS)N�/���)r$�splitr"rrr�basename;�zS3Uri.basename)r�
__module__�__qualname__rrrr#r$r(r*r.rrrrr
sr
c@s�eZdZdZe�dejejB�Zdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zeddd��Zedd��ZdS)�S3UriS3�s3z^s3:///*([^/]*)/?(.*)cCs<|j�|�}|std|��|��}|d|_|d|_dS)Nz%s: not a S3 URIrr)�_re�matchr�groups�_bucket�_object�rrr5r6rrrrAs
zS3UriS3.__init__cC�|jSr)r7r"rrr�bucketI�zS3UriS3.bucketcCr:r)r8r"rrrrLr<zS3UriS3.objectcC�
t|j�Sr)�boolr7r"rrr�
has_bucketO�
zS3UriS3.has_bucketcCr=r)r>r8r"rrr�
has_objectRr@zS3UriS3.has_objectcCsd�d|j|jg�S)Nr+zs3:/)�joinr7r8r"rrrr!U�zS3UriS3.uricCstt��j|j�Sr)rr�host_bucketr7r"rrr�is_dns_compatibleXr/zS3UriS3.is_dns_compatiblecCsNd}t��jr	d}|��rd||jt��j|jfSd|t��j|j|jfS)N�http�httpsz
%s://%s.%s/%sz
%s://%s/%s/%s)r�public_url_use_httpsrEr7�	host_baser8)r�public_url_protocolrrrr*[s
zS3UriS3.public_urlcCs|��r	d|jSdS)Nz%s.s3.amazonaws.com�s3.amazonaws.com)rEr7r"rrr�	host_nameds
zS3UriS3.host_name�cCsd||fS)Nz
s3://%s/%sr�r;rrrr�compose_urijszS3UriS3.compose_uricCs�t�d|tjtjB�}|��dd�\}}|��}|dkr2|�d�dkr)|}d}n|�dd�\}}n|�d�rA|dt	d��}nt
d|��td	||d
��S)Nz(https?://)?([^/]+)/?(.*)rrKr+rrMz.s3.amazonaws.comzUnable to parse URL: %szs3://%(bucket)s/%(object)srN)�rer5�
IGNORECASE�UNICODEr6�lower�countr-�endswith�lenrr
)�http_url�m�hostnamerr;rrr�httpurl_to_s3urins

�zS3UriS3.httpurl_to_s3uriN)rM)rr0r1rrP�compilerQrRr4rr;rr?rAr!rEr*rL�staticmethodrOrZrrrrr2>s 	r2c@�DeZdZdZe�dejejB�Zdd�Z	dd�Z
dd�Zd	d
�ZdS)�	S3UriS3FS�s3fsz^s3fs:///*([^/]*)/?(.*)cCsB|j�|�}|std|��|��}|d|_|d�d�|_dS)Nz%s: not a S3fs URIrrr+)r4r5rr6�_fsnamer-�_pathr9rrrr�s
zS3UriS3FS.__init__cCr:r)r`r"rrr�fsname�r<zS3UriS3FS.fsnamecCsd�|j�S)Nr+�rBrar"rrr�path�szS3UriS3FS.pathcCsd�d|j|��g�S)Nr+zs3fs:/)rBr`rdr"rrrr!�sz
S3UriS3FS.uriN)
rr0r1rrPr[rQrRr4rrbrdr!rrrrr^��r^c@sNeZdZdZe�dej�Zdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dS)�	S3UriFile�filez^(\w+://)?(.*)cCsb|j�|�}|��}|ddvrtd|��|ddur'|d�tj�|_dS|d�d�|_dS)Nr)Nzfile://z%s: not a file:// URIrr+)r4r5r6rr-�os�seprar9rrrr�szS3UriFile.__init__cCstj�|j�Sr)rhrirBrar"rrrrd�szS3UriFile.pathcCsd�dg|j�S)Nr+zfile:/rcr"rrrr!�r/z
S3UriFile.uricCstj�t|����Sr)rhrd�isdirrr"rrrrj�rCzS3UriFile.isdircC�ttj�t|�����Sr)rrhrd�dirnamerr"rrrrl�r)zS3UriFile.dirnamecCrkr)rrhrdr.rr"rrrr.�r)zS3UriFile.basenameN)rr0r1rrPr[rRr4rrdr!rjrlr.rrrrrf�s
rfc@r])�S3UriCloudFront�cfz^cf://([^/]*)/*(.*)cCsL|j�|�}|std|��|��}|d|_|ddkr!|dp"d|_dS)Nz%s: not a CloudFront URIrrr+)r4r5rr6�_dist_id�_request_idr9rrrr�s
zS3UriCloudFront.__init__cCr:r)ror"rrr�dist_id�r<zS3UriCloudFront.dist_idcCr:r)rpr"rrr�
request_id�r<zS3UriCloudFront.request_idcCs(d|��}|��r|d|��7}|S)Nzcf://r+)rqrr)rr!rrrr!�szS3UriCloudFront.uriN)
rr0r1rrPr[rQrRr4rrqrrr!rrrrrm�rerm�__main__zs3://bucket/objectz	type()  =z	uri     =z	uri.type=z	bucket  =z	object  =zs3://bucketz*s3fs://filesystem1/path/to/remote/file.txtz	path    =z/path/to/local/file.txtzcf://1234567890ABCD/z	dist_id =)�
__future__rrrhrPr�UtilsrrrrMr�version_infor rr
r2r^rfrmrr!�printrr;rdrqrrrr�<module>sZ
)G





�

https://t.me/RX1948 - 2025