%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/web/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/web/__pycache__/sux.cpython-312.pyc

�

Ϫ�f�Q���dZddlmZddlmZdZdZdZdZedzZ	d�Z
d	�Zd
�Zd�Z
d�ZGd
�de�ZGd�de�Zy)a�
*S*mall, *U*ncomplicated *X*ML.

This is a very simple implementation of XML/HTML as a network
protocol.  It is not at all clever.  Its main features are that it
does not:

  - support namespaces
  - mung mnemonic entity references
  - validate
  - perform *any* external actions (such as fetching URLs or writing files)
    under *any* circumstances
  - has lots and lots of horrible hacks for supporting broken HTML (as an
    option, they're not on by default).
�)�Protocol)�prefixedMethodNames��z.-_:z;+#/%~c��y)zDo nothing.N�)�args�kws  �1/usr/lib/python3/dist-packages/twisted/web/sux.py�nopr$s��c��g}|D]}|j|��|D�cic]}|d��}}|j�Scc}w)Nr)�extend�keys)r	�l�x�ds    r�	unionlistr(sH��
�A�
���	��������!��A���A���6�6�8�O��	s�
;c����|jdt��i}td�|D��D]�t��fd�|D��|�<�|S)N�defaultc3�<K�|]}|j����y�w�N)r)�.0�fndicts  r�	<genexpr>zzipfndict.<locals>.<genexpr>3s����<�V�6�;�;�=�<�s�c3�B�K�|]}|j������y�wr)�get)rrr�keys  ��rrzzipfndict.<locals>.<genexpr>4s�����9�q�q�u�u�S�'�*�9�s�)rrr�tuple)r	r
rrrs   @@r�	zipfndictr 0sK����f�f�Y��$�G�
�A��<�t�<�=�:���9�D�9�9��#��:��Hr
c	�\�t||�D�cic]}|t|||z���c}Scc}wr)r�getattr)�clazz�prefix�names   r�prefixedMethodClassDictr&8s;��(��v�6���	
�g�e�V�d�]�+�+����s�)c	�p�t|j|�D�cic]}|t|||z���c}Scc}wr)r�	__class__r")�objr$r%s   r�prefixedMethodObjDictr*?s?��(��
�
�v�>���	
�g�c�6�D�=�)�)����s�3c��eZdZd�Zdefd�Zy)�
ParseErrorc�<�||_||_||_||_yr��filename�line�col�message)�selfr/r0r1r2s     r�__init__zParseError.__init__Gs�� ��
���	������r
�returnc�l�|j�d|j�d|j�d|j��S)N�:z: r.�r3s r�__str__zParseError.__str__Ms/���-�-���$�)�)��A�d�h�h�Z�r�$�,�,��H�Hr
N)�__name__�
__module__�__qualname__r4�strr9rr
rr,r,Fs���I��Ir
r,c�~�eZdZdZdZdZdZdZdZd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d Z%d Z&d!�Z'd"�Z(d#�Z)d$�Z*d%�Z+d&�Z,d'�Z-d(�Z.d)�Z/d*�Z0d+�Z1d,�Z2d-�Z3d.�Z4d/�Z5d0�Z6d1�Z7d2�Z8d3�Z9d4�Z:e2Z;e3Z<d5�Z=d6�Z>d7�Z?d8�Z@d9�ZAd:�ZBd;�ZCy)<�	XMLParserNz<xml />rc�.�d|_d|_g|_y)Nrr)�lineno�colno�	encodingsr8s r�connectionMadezXMLParser.connectionMade]s�������
���r
c�2�|j|jfS)z;Get the line number and column of the last character parsed)rArBr8s r�saveMarkzXMLParser.saveMarkbs�����T�Z�Z�(�(r
c�R�t|jf|j�z|fz��r)r,r/rF)r3r2s  r�_parseErrorzXMLParser._parseErrorgs&���D�M�M�+�d�m�m�o�=��
�J�L�Lr
c�~��t�jdd�}|�"t�fd�dD��x}�j_|S)z;Return a dictionary of begin, do, end state function tuples�__stateTableNc3�6�K�|]}t�|����y�wr)r*)rr$r3s  �rrz-XMLParser._buildStateTable.<locals>.<genexpr>rs �������*�$��7��s�)�begin_�do_�end_)r"r(r �_XMLParser__stateTable)r3�
stateTables` r�_buildStateTablezXMLParser._buildStateTablejsJ���
�T�^�^�^�T�B�
���7@��";��8�
�J����4��r
c���d|jvsd|jvrt|�dzrJd��|jr|j|z}|jD]}t||�}�|S)N�UTF-16zUCS-2rz!UTF-16 must come in pairs for now)rC�len�_prependr=)r3�data�encodings   r�_decodezXMLParser._decodeysi���t�~�~�%��D�N�N�)B��4�y�1�}�I�&I�I�$��=�=��=�=�4�'�D����	'�H��t�X�&�D�	'��r
c�|�|jry|jdk(r d|jvr|jd�yy)N�bodydata�script�src�waitforendscript)�endtag�tagName�
tagAttributes�begin_bodydatar8s r�
maybeBodyDatazXMLParser.maybeBodyData�s=���;�;���<�<�8�#��T�5G�5G�(G�
����%�%�r
c����|j�}|jsB|jd�r*|dd|_|jjd�|dd}d|_|jr|j
|�}n|jd�}|j|jc��|j}|j}��fd�}||_
||\}}}	|D]?}	|	dk(r�d	z
�d�n�d	z
�||	�}
|
�� |
|k7s�&|�|
}||\}}}||	��A	||_
��c|_|_	||_y#||_
��c|_|_	wxYw)
N)s��s��rrrS�beginzutf-8c�����fSrr)rBrAs��rrFz(XMLParser.dataReceived.<locals>.saveMark�s
����E�?�"r
�
r)rQ�state�
startswithrUrC�appendrX�decoderArBrF)
r3rVrP�curState�	_saveMarkrF�beginFn�doFn�endFn�byte�newStaterBrAs
           @@r�dataReceivedzXMLParser.dataReceived�sb����*�*�,�
��z�z����9�:� $�Q�q�	��
����%�%�h�/��A�B�x�� �D�J��>�>��<�<��%�D��;�;�w�'�D����T�Z�Z�
����:�:���M�M�	�	#�!��
�)�(�3����u�	4��

"���4�<��a�K�F��E��Q�J�E���:���'�H��,@��G�'�H�+5�h�+?�(�G�T�5��D�M�

"�&�D�M�&,�e�#�D�K�����
��&�D�M�&,�e�#�D�K���s�!D;�:D;�D;�;Ec�Z�|j�}||jt�y)z0
        End the last state we were in.
        N)rQrg�END_HANDLER)r3�reasonrPs   r�connectionLostzXMLParser.connectionLost�s(���*�*�,�
�+�
�4�:�:��{�+�-r
c��|j�ry|dk7r)|jr||_y|jd|�d��y)N�<rZzFirst char of document [z
] wasn't <�tagstart)�isspace�beExtremelyLenient�_leadingBodyDatarH�r3rps  r�do_beginzXMLParser.do_begin�sD���<�<�>���3�;��&�&�(,��%�!����7��x�z�J�K�r
c��d|_y�N�)�
commentbufr}s  r�
begin_commentzXMLParser.begin_comment�s	����r
c��|xj|z
c_|jjd�r|j|jdd�yy)Nz-->���rZ)r��endswith�
gotCommentr}s  r�
do_commentzXMLParser.do_comment�sA�����4����?�?�#�#�E�*��O�O�D�O�O�C�R�0�1��+r
c�<�d|_i|_d|_d|_y�Nr�r)r_r`�termtagr^r}s  r�begin_tagstartzXMLParser.begin_tagstart�s�������������r
c�:�|j�s|tvr&|xj|z
c_|jdk(ryy|j�r,|jr|jryy|jd�y|dk(rg|jr|j
|j�y|j|ji�|jxrdxs|j�S|dk(r|jry	d
|_y|dvrH|jr|js/|jd�y|xj|z
c_d
|_
yy|d
k(r"|jdk(ry|jd�y|jrd|_y|jd|z�y)Nz!--�comment�	waitforgt�attrszWhitespace before tag-name�>rZ�/�
afterslashr�!?zInvalid character in tag-name�[�!�expectcdatazInvalid '[' in tag-namerx�unentityzInvalid tag character: %r)�isalnum�
identCharsr_rzr^rH�	gotTagEnd�gotTagStartr{rbr�rZr}s  r�do_tagstartzXMLParser.do_tagstart�sc���<�<�>�T�Z�/��L�L�D� �L��|�|�u�$� �%�
�\�\�^��|�|��;�;�'��� � �!=�>�
�S�[��{�{����t�|�|�,�!�� � ����r�2��0�0�0�@�j�X�D�DV�DV�DX���S�[��|�|�#����
�T�\��|�|��.�.��$�$�%D�E�����$�� ���	/�
�S�[��|�|�s�"�$�� � �!:�;��&�&� #��
�!����8�4�?�@r
c�.�|xj|z
c_yr�rZr}s  r�begin_unentityzXMLParser.begin_unentitys���
�
���
r
c�.�|xj|z
c_y)NrZr�r}s  r�do_unentityzXMLParser.do_unentitys���
�
���
�r
c�:�|j|j�yr��gotTextrZr8s r�end_unentityzXMLParser.end_unentitys�����T�]�]�#r
c��||_yr)�cdatabufr}s  r�begin_expectcdatazXMLParser.begin_expectcdatas	����
r
c��|xj|z
c_|j}d}t|�t|�kDr0|j|�ry|jry|j	d�||k(rd|_y|j	d�y)Nz[CDATA[r�zMal-formed CDATA headerr��cdata)r�rTrhr{rH)r3rp�cdb�cds    r�do_expectcdatazXMLParser.do_expectcdata!sz���
�
���
��m�m��
���r�7�S��X���}�}�S�!���(�(�
#�� � �!:�;�
��9��D�M�����2�3r
c��|xj|z
c_|jjd�r|jdd|_yy)Nz]]>r�rZ)r�r�r}s  r�do_cdatazXMLParser.do_cdata5s<���
�
���
��=�=�!�!�%�(� �M�M�#�2�.�D�M��)r
c�H�|j|j�d|_yr�)�gotCDatar�r8s r�	end_cdatazXMLParser.end_cdata;s���
�
�d�m�m�$���
r
c��|j�s|tvr#|jdk(ry|jddvryy|j�ry|dk(rI|j	|j|j
�|jxrdxs|j�S|d	k(ry
|jry|jd|z�y)N�!DOCTYPE�doctyperr�r��attrnamer�rZr�r�zUnexpected character: %r)	r�r�r_rzr�r`r{rbrHr}s  r�do_attrszXMLParser.do_attrs?s����<�<�>�T�Z�/��|�|�z�)� ��|�|�A��$�&�"��
�\�\�^��
�S�[����T�\�\�4�+=�+=�>��/�/�/�?�Z�W�4�CU�CU�CW�W�
�S�[��
�
$�
$�
����3�d�:�;r
c��||_yr�r�r}s  r�
begin_doctypezXMLParser.begin_doctypeT�	����r
c�:�|dk(ry|xj|z
c_y�Nr�rZr�r}s  r�
do_doctypezXMLParser.do_doctypeWs���3�;�������r
c�H�|j|j�d|_yr)�
gotDoctyper�r8s r�end_doctypezXMLParser.end_doctype\s��������%���r
c�`�|dk(r)|js|jsy|j�Syr�)r^r{rbr}s  r�do_waitforgtzXMLParser.do_waitforgt`s/���3�;��{�{�$�"9�"9�!��%�%�'�'�r
c� �||_d|_y�Nr)r��_attrname_termtagr}s  r�begin_attrnamezXMLParser.begin_attrnamefs����
�!"��r
c��|j�s|tvr|xj|z
c_y|dk(ry|j�ry|jr�|dvry|t
vs|j�r|xj|z
c_y|dk(rd|_y|dk(r�d	|_|j|j|j<|j|j|j�|jr|j|j�y
|j�Sy|jd|j�d|���y)
N�=�
beforeattrval�beforeeq�"'�attrvalr�rr��TruerZzInvalid attribute name: � )r�r�r�rzr{�lenientIdentCharsr�r�r`r�r_r�rbrHr}s  r�do_attrnamezXMLParser.do_attrnamejs���<�<�>�T�Z�/��M�M�T�!�M��
�S�[�"�
�\�\�^��
�
$�
$��u�}� ��(�(�D�L�L�N��
�
��%�
���s�{�)*��&���s�{�%���48�L�L��"�"�4�=�=�1�� � ����t�/A�/A�B��)�)��N�N�4�<�<�0�%��)�)�+�+�
����3�D�M�M�3D�A�d�X�N�Or
c�x�|dvry|j�ry|jr�|tvs|j�ry|dk(r`d|_|j|j
|j<|j|j|j
�|j�S|dk(ry|jd|z�y)Nr�r��	messyattrr�r��\zEInvalid initial attribute value: %r; Attribute values must be quoted.)rzr{r�r�r�r`r�r�r_rbrHr}s  r�do_beforeattrvalzXMLParser.do_beforeattrval�s����5�=��
�\�\�^��
�
$�
$��(�(�D�L�L�N�"��s�{�%���48�L�L��"�"�4�=�=�1�� � ����t�/A�/A�B��)�)�+�+��t�|�����S��
�	
r
r�c��d|_yr�)�_beforeeq_termtagr}s  r�begin_beforeeqzXMLParser.begin_beforeeq�s
��!"��r
c�&�|dk(ry|j�ry|jr�|j�s|tvr+d|_|j|j
|j<y|dk(r�d|_|j|j
|j<|j|j|j
�|jr|j|j�y|j�S|dk(rd|_	y|jd	�y)
Nr�r�r�r�r�rZr�rzInvalid attribute)
rzr{r�r�r�r`r�r�r_r�r�rbrHr}s  r�do_beforeeqzXMLParser.do_beforeeq�s����3�;�"�
�\�\�^��
�
$�
$��|�|�~���!3�%���48�L�L��"�"�4�=�=�1�!����%���48�L�L��"�"�4�=�=�1�� � ����t�/A�/A�B��)�)��N�N�4�<�<�0�%��)�)�+�+����)*��&�����,�-r
c� �||_d|_yr���	quotetyper�r}s  r�
begin_attrvalzXMLParser.begin_attrval�s�������r
c�N�||jk(ry|xj|z
c_y)Nr�r�r}s  r�
do_attrvalzXMLParser.do_attrval�s���4�>�>�!�������r
c�f�|j|j|j<dx|_|_yr��r�r`r�r8s r�end_attrvalzXMLParser.end_attrval�s(��,0�L�L����4�=�=�)�')�)��
��r
c��||_yr)r�r}s  r�begin_messyattrzXMLParser.begin_messyattr�r�r
c��|j�ry|dk(r�d}|jjd�rd}|jdd|_|j|j|j<|j|j|j�|r|j|j�y|j�S|xj|z
c_y)Nr�r�rr�r���rZ)	rzr�r�r`r�r�r_r�rb)r3rp�endTags   r�do_messyattrzXMLParser.do_messyattr�s����<�<�>��
�S�[��F��|�|�$�$�S�)���#�|�|�C�R�0���04���D���t�}�}�-����T�\�\�4�+=�+=�>�����t�|�|�,�!��%�%�'�'��L�L�D� �Lr
c�d�|jr$|j|j|j<yyrr�r8s r�
end_messyattrzXMLParser.end_messyattr�s&���<�<�04���D���t�}�}�-�r
c��d|_yr�)�_after_slash_closedr}s  r�begin_afterslashzXMLParser.begin_afterslash�s
��#$�� r
c��|jr|jd�|dk7r|jry|jd�d|_|j|j|j
�|j
|j�y)Nz
Mal-formedr�zNo data allowed after '/'rrZ)r�rHr{r�r_r`r�r}s  r�
do_afterslashzXMLParser.do_afterslash�sr���#�#����\�*��3�;��&�&��� � �!<�=�#$�� �������t�'9�'9�:����t�|�|�$�r
c�R�|jr|j|_|`yd|_yr�)r|rZr}s  rrazXMLParser.begin_bodydata�s%��� � � �1�1�D�M��%��D�Mr
c�F�|dk(ry|dk(ry|xj|z
c_y)Nrxry�&�	entityrefr�r}s  r�do_bodydatazXMLParser.do_bodydata�s$���3�;���3�;���
�
���
r
c�H�|j|j�d|_yr�r�r8s r�end_bodydatazXMLParser.end_bodydatas�����T�]�]�#���
r
c�:�|dk(ry|xj|z
c_y)Nrx�waitscriptendtagr�r}s  r�do_waitforendscriptzXMLParser.do_waitforendscripts���3�;�%��
�
���
r
c�.�d|_d|_d|_yr�)�temptagdatar_r^r}s  r�begin_waitscriptendtagz XMLParser.begin_waitscriptendtag
s����������r
c�p�|xj|z
c_|dk(rd|_y|js#|xjd|jzz
c_y|j�s|tvr�|xj
|z
c_dj
|j
�s#|xjd|jzz
c_y|j
dk(r7|j|j�|j|j
�yy|j�ry|xjd|jzz
c_y)Nr�Trxr]r[r�r�)
r�r^rZr�r�r_rhr�r�rzr}s  r�do_waitscriptendtagzXMLParser.do_waitscriptendtags���	
���D� ���3�;��D�K�����M�M�S�4�#3�#3�3�3�M�%�
�\�\�^�t�z�1��L�L�D� �L��&�&�t�|�|�4��
�
��t�'7�'7�!7�7�
�)�����)����T�]�]�+����t�|�|�,�"�*�
�\�\�^�%�
�M�M�S�4�#3�#3�3�3�M�%r
c� �d|_d|_yr�)�erefbuf�	erefextrar}s  r�begin_entityrefzXMLParser.begin_entityref6s�������r
c�>�|j�s|dk(rm|jrO|jr |jdk7r|j|_d|_|dk(ry|xj|z
c_y|j	d�y|dk7r|xj|z
c_yy)Nrx�ampry�
spacebodydatazBad entity reference�;rZ)rzr{rrrHr}s  r�do_entityrefzXMLParser.do_entityref:s����<�<�>�T�S�[��&�&��<�<�D�L�L�E�$9�%)�\�\�D�N�$����3�;�%��N�N�d�*�N�*����3�4�
�S�[��L�L�D� �L�r
c�:�|j|j�yr)�gotEntityReferencerr8s r�
end_entityrefzXMLParser.end_entityrefLs��������-r
c�4�|j|_d|_yr)rrZr}s  r�begin_spacebodydatazXMLParser.begin_spacebodydataQs������
���r
c��td||�y)zCEncountered an opening tag.

        Default behaviour is to print.rdN��print)r3r%�
attributess   rr�zXMLParser.gotTagStartZs��	�g�t�Z�(r
c�.�tdt|��y)z8Encountered text

        Default behaviour is to print.ztext:N�r�repr)r3rVs  rr�zXMLParser.gotText`s��	�g�t�D�z�"r
c� �td|z�y)zMEncountered mnemonic entity reference

        Default behaviour is to print.zentityRef: &%s;Nr)r3�	entityRefs  rrzXMLParser.gotEntityReferencefs��	��)�+�,r
c��y)z=Encountered comment.

        Default behaviour is to ignore.Nr)r3r�s  rr�zXMLParser.gotCommentls��	
r
c�&�|j|�y)zJEncountered CDATA

        Default behaviour is to call the gotText methodN)r�)r3r�s  rr�zXMLParser.gotCDatars��	
���U�r
c�.�tdt|��y)z�Encountered DOCTYPE

        This is really grotty: it basically just gives you everything between
        '<!DOCTYPE' and '>' as an argument.
        r�Nr)r3r�s  rr�zXMLParser.gotDoctypexs��	�j�$�w�-�(r
c��td|�y)z?Encountered closing tag

        Default behaviour is to print.�endNr)r3r%s  rr�zXMLParser.gotTagEnd�s��	�e�T�r
)Dr:r;r<rgrCr/r{rUr|rDrFrHrQrXrbrrrvr~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�rar�r�r�r�rrr	rr�do_spacebodydata�end_spacebodydatar�r�rr�r�r�r�rr
rr?r?QsW���E��I��H����H�
���
)�
M�
���(,�\.�����,A�\��$��4�(��<�*��
�(�#�P�<
�,�H��G�#�.�.��
*��!�"=�%�� ����
�
%&�N��$.�
�#��$��)�#�-�
��)�r
r?N)�__doc__�twisted.internet.protocolr�twisted.python.reflectr�
BEGIN_HANDLER�
DO_HANDLERrtr�r�rrr r&r*�	Exceptionr,r?rr
r�<module>r%sh���"/�6��
�
�
���
�
���)����
���I��I�s��sr

Zerion Mini Shell 1.0