PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/twisted/words/protocols/jabber/__pycache__

Просмотр файла: xmpp_stringprep.cpython-310.pyc

o

�bt�@s�ddlZddlmZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
dZe
ed	d
dd�ded
�Gdd�de�ZGdd�de�Ze	e�Gdd�d��Ze	e�Gdd�d��Ze	e�Gdd�d��Ze	e�Gdd�d��ZGdd�d�ZGdd�d�Zeej�Zeej�Zeej�Zeej�Zeej �Z!eej"�Z#eej$�Z%eej&�Z'eej(�Z)eej*�Z+eej,�Z-eej.�Z/eej0�Z1ee/e1geeeee!e#e%e'e)e+e-egd��gd�Z2ee/geeee!e#e%e'e)e+e-g
d�Z3e�Z4dS) �N)�idna)�chain)�	ucd_3_2_0)�	Interface�implementer)�Version)�deprecatedModuleAttributeF�Twisted�
�zcrippled is always False�crippledc@�eZdZdZdd�ZdS)�ILookupTablez1
    Interface for character lookup classes.
    cC�dS)z<
        Return whether character is in this table.
        N���crr�P/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/xmpp_stringprep.py�lookup�zILookupTable.lookupN)�__name__�
__module__�__qualname__�__doc__rrrrrr�rc@r
)�
IMappingTablez2
    Interface for character mapping classes.
    cCr)z/
        Return mapping for character.
        Nrrrrr�map)rzIMappingTable.mapN)rrrrrrrrrr$rrc@�eZdZdd�ZdS)�LookupTableFromFunctioncC�
||_dS�N)r��self�in_table_functionrrr�__init__1�
z LookupTableFromFunction.__init__N�rrrr$rrrrr/�rc@�eZdZdd�Zdd�ZdS)�LookupTablecCrr ��_table)r"�tablerrrr$7r%zLookupTable.__init__cCs
||jvSr r*�r"rrrrr:r%zLookupTable.lookupN)rrrr$rrrrrr)5�r)c@r)�MappingTableFromFunctioncCrr )r)r"�map_table_functionrrrr$@r%z!MappingTableFromFunction.__init__Nr&rrrrr/>r'r/c@r()�EmptyMappingTablecCrr ��_in_table_functionr!rrrr$Fr%zEmptyMappingTable.__init__cCs|�|�rdS|Sr r2r-rrrrIs
zEmptyMappingTable.mapN)rrrr$rrrrrr1Dr.r1c@sHeZdZgdgddfdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�ProfileTcCs"||_||_||_||_||_dSr )�mappings�	normalize�prohibiteds�do_check_unassigneds�
do_check_bidi)r"r5r6r7�check_unassigneds�
check_bidirrrr$Qs

zProfile.__init__cCsJ|�|�}|jrt�d|�}|�|�|jr|�|�|jr#|�|�|S)N�NFKC)rr6�unicodedata�check_prohibitedsr8r:r9�check_bidirectionals)r"�string�resultrrr�prepare_s



zProfile.preparecCsPg}|D]}|}|jD]
}|�|�}||krnq|dur"|�|�qd�|�S)N�)r5r�append�join)r"r@rAr�result_c�mappingrrrrjs

�
�
zProfile.mapcCs4|D]}|jD]}|�|�rtdt|���qqdS�NzInvalid character %s)r7r�UnicodeError�repr)r"r@rr,rrrr>zs

���zProfile.check_prohibitedscCs(|D]}t�|�rtdt|���qdS)NzUnassigned code point %s)�
stringprep�in_table_a1rIrJ�r"r@rrrrr:��

��zProfile.check_unassignedscCsnd}d}|D]}t�|�rd}t�|�rd}q|r|rtd��|r3t�|d�r/t�|d�s5td��dSdS)NFTzViolation of BIDI Requirement 2r���zViolation of BIDI Requirement 3)rK�in_table_d1�in_table_d2rI)r"r@�
found_LCat�found_RandALCatrrrrr?�s"

����zProfile.check_bidirectionalsN)	rrrr$rBrr>r:r?rrrrr4Ps
�r4c	@s`eZdZdZdd�eedd�edd�edd	�ed
d�edd
��D�Zdd�Zdd�Zdd�Z	dS)�NamePrepa�Implements preparation of internationalized domain names.

    This class implements preparing internationalized domain names using the
    rules defined in RFC 3491, section 4 (Conversion operations).

    We do not perform step 4 since we deal with unicode representations of
    domain names and do not convert from or to ASCII representations using
    punycode encoding. When such a conversion is needed, the C{idna} standard
    library provides the C{ToUnicode()} and C{ToASCII()} functions. Note that
    C{idna} itself assumes UseSTD3ASCIIRules to be false.

    The following steps are performed by C{prepare()}:

      - Split the domain name in labels at the dots (RFC 3490, 3.1)
      - Apply nameprep proper on each label (RFC 3491)
      - Enforce the restrictions on ASCII characters in host names by
        assuming STD3ASCIIRules to be true. (STD 3)
      - Rejoin the labels using the label separator U+002E (full stop).

    cCsg|]}t|��qSr)�chr)�.0�nrrr�
<listcomp>�s��zNamePrep.<listcomp>r�-�.�0�:�A�[�a�{�cCs\g}tj�|�}|rt|d�dkrd}|d=nd}|D]
}|�|�|��qd�|�|S)NrOr�.rC)r�dots�split�lenrD�namepreprE)r"r@rA�labels�trailing_dot�labelrrrrB�szNamePrep.preparecCs(|D]}||jvrtdt|���qdSrH)r7rIrJrMrrrr>�rNzNamePrep.check_prohibitedscCs@t�|�}|�|�|ddkrtd��|ddkrtd��|S)Nr�-zInvalid leading hyphen-minusrOzInvalid trailing hyphen-minus)rrfr>rI)r"rirrrrf�s

zNamePrep.nameprepN)
rrrrr�ranger7rBr>rfrrrrrT�s��rT)�"�&�'�/�:�<�>�@)r5r7)5rK�	encodingsr�	itertoolsrr=r�zope.interfacerr�incrementalr�twisted.python.deprecaterrrrrrr)r/r1r4rT�in_table_c11�C_11�in_table_c12�C_12�in_table_c21�C_21�in_table_c22�C_22�in_table_c3�C_3�in_table_c4�C_4�in_table_c5�C_5�in_table_c6�C_6�in_table_c7�C_7�in_table_c8�C_8�in_table_c9�C_9�in_table_b1�B_1�map_table_b2�B_2�nodeprep�resourcepreprfrrrr�<module>st�H
A












����


Выполнить команду


Для локальной разработки. Не используйте в интернете!