%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/
Upload File :
Create Path :
Current File : //opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyo

�
�wMVc@`sddlmZmZmZddlmZddlZejZyddlm	Z	Wne
k
rhnXddlmZm
Z
mZddlmZmZmZddlmZdd	lmZd
je�ZyddlmZmZWne
k
rdZn�Xd
ZiZed�dkZx�eej��D]�\Z Z!erYee!�dks5erxee!�dkrxq5ne!dkr5ee!�dkr�ej"e!�Z!ne#e!�Z!e!eks�e j$�r�e ee!<q�q5q5Wd�Z%eee%�[de&fd��YZ'd�Z(dS(i(tabsolute_importtdivisiontunicode_literals(t	text_typeN(treducei(tvoidElementstbooleanAttributestspaceCharacters(trcdataElementstentitiestxmlEntities(tutils(tescapeu(tregister_errortxmlcharrefreplace_errorsustrictuhtmlentityreplaceu􏿿iu&c
C`st|ttf�rqg}g}t}x�t|j|j|j!�D]�\}}|rbt}qDn||j}tj	|j|t
|j|dg�!�r�tj|j||d!�}t}nt
|�}|j|�qDWxz|D]r}tj|�}	|	r<|jd�|j|	�|	jd�sW|jd�qWq�|jdt|�d�q�Wdj|�|jfSt|�SdS(Niu&u;u&#x%s;u(t
isinstancetUnicodeEncodeErrortUnicodeTranslateErrortFalset	enumeratetobjecttstarttendRtisSurrogatePairtmintsurrogatePairToCodepointtTruetordtappendtencode_entity_maptgettendswiththextjoinR(
texctrest
codepointstskiptitctindext	codepointtcpte((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pythtmlentityreplace_errors*s0)
,	


tHTMLSerializercB`s�eZeZdZeZeZeZeZ	eZ
eZeZeZ
eZeZeZeZdZd�Zd�Zd�Zdd�Zdd�Zdd�ZRS(u"uquote_attr_valuesu
quote_charuuse_best_quote_charuomit_optional_tagsuminimize_boolean_attributesuuse_trailing_solidususpace_before_trailing_solidusuescape_lt_in_attrsu
escape_rcdatauresolve_entitiesualphabetical_attributesuinject_meta_charsetustrip_whitespaceusanitizec	K`sgd|krt|_nx6|jD]+}t|||j|t||���q"Wg|_t|_dS(u�Initialize HTMLSerializer.

        Keyword options (default given first unless specified) include:

        inject_meta_charset=True|False
          Whether it insert a meta element to define the character set of the
          document.
        quote_attr_values=True|False
          Whether to quote attribute values that don't require quoting
          per HTML5 parsing rules.
        quote_char=u'"'|u"'"
          Use given quote character for attribute quoting. Default is to
          use double quote unless attribute value contains a double quote,
          in which case single quotes are used instead.
        escape_lt_in_attrs=False|True
          Whether to escape < in attribute values.
        escape_rcdata=False|True
          Whether to escape characters that need to be escaped within normal
          elements within rcdata elements such as style.
        resolve_entities=True|False
          Whether to resolve named character entities that appear in the
          source tree. The XML predefined entities &lt; &gt; &amp; &quot; &apos;
          are unaffected by this setting.
        strip_whitespace=False|True
          Whether to remove semantically meaningless whitespace. (This
          compresses all whitespace to a single space except within pre.)
        minimize_boolean_attributes=True|False
          Shortens boolean attributes to give just the attribute value,
          for example <input disabled="disabled"> becomes <input disabled>.
        use_trailing_solidus=False|True
          Includes a close-tag slash at the end of the start tag of void
          elements (empty elements whose end tag is forbidden). E.g. <hr/>.
        space_before_trailing_solidus=True|False
          Places a space immediately before the closing slash in a tag
          using a trailing solidus. E.g. <hr />. Requires use_trailing_solidus.
        sanitize=False|True
          Strip all unsafe or unknown constructs from output.
          See `html5lib user documentation`_
        omit_optional_tags=True|False
          Omit start/end tags that are optional.
        alphabetical_attributes=False|True
          Reorder attributes to be in alphabetical order.

        .. _html5lib user documentation: http://code.google.com/p/html5lib/wiki/UserDocumentation
        u
quote_charN(Rtuse_best_quote_chartoptionstsetattrRtgetattrterrorststrict(tselftkwargstattr((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyt__init__ks.)	cC`s$|jr|j|jt�S|SdS(N(tencodingtencodetunicode_encode_errors(R4tstring((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyR9�s	cC`s$|jr|j|jd�S|SdS(Nustrict(R8R9(R4R;((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pytencodeStrict�s	c#`sF||_t}g|_|rI|jrIddlm}|||�}n|jrqddlm}||�}n|jr�ddl	m}||�}n|j
r�ddlm}||�}n|jr�ddl
m}||�}nxV|D]N}|d}|dkr�d|d}|dr9|d|d7}n|d	rP|d
7}n|d	r�|d	jd�dkr�|d	jd
�dkr�|jtd��nd
}nd}|d||d	|f7}n|d7}|j|�Vq�|d1krm|dks|rR|r=|djd�dkr=|jtd��n|j|d�Vq>|jt|d��Vq�|d2kr�|d}	|jd|	�V|	tkr�|jr�t}n|r�|jtd��nx�|dj�D]�\\}
}}|}
|�|jd�V|j|
�V|js[|
tj|	t��kr�|
tjdt��kr�|jd�V|jsy�r�t}nt�fd�tdt�}�jdd ��|j r��jd!d"��n|r�|j!}|j"r.d
�kr
d�kr
d}q.d�kr.d
�kr.d
}q.n|d
krO�jd
d#��n�jdd$��|j|�V|j��V|j|�Vq�|j��Vq�q�W|	t#kr�|j$r�|j%r�|jd%�Vq�|jd&�Vn|jd�Vq�|d'krP|d}	|	tkrt}n|r;|jtd��n|jd(|	�Vq�|d)kr�|d}|jd*�dkr�|jtd+��n|jd,|d�Vq�|d-kr-|d}	|	d.}|t&kr�|jtd/|	��n|j'r|t(krt&|}n
d0|	}|j|�Vq�|j|d�q�WdS(3Ni(tFilterutypeuDoctypeu<!DOCTYPE %sunameupublicIdu PUBLIC "%s"usystemIdu SYSTEMu"iu'uASystem identifer contains both single and double quote charactersu %s%s%su>u
CharactersuSpaceCharactersudatau</uUnexpected </ in CDATAuStartTaguEmptyTagu<%su+Unexpected child element of a CDATA elementu uu=c`s|p|�kS(N((txty(tv(s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyt<lambda>�su>"'=u&u&amp;u<u&lt;u&#39;u&quot;u /u/uEndTagu</%s>uCommentu--uComment contains --u	<!--%s-->uEntityu;uEntity %s not recognizedu&%s;(u
CharactersuSpaceCharacters(uStartTaguEmptyTag()R8RR2tinject_meta_charsettfilters.inject_meta_charsetR=tstrip_whitespacetfilters.whitespacetsanitizetfilters.sanitizertomit_optional_tagstfilters.optionaltagstalphabetical_attributestfilters.alphabeticalattributestfindtserializeErrort_R<R9RRt
escape_rcdataRtitemstminimize_boolean_attributesRRttupletquote_attr_valuesRRtreplacetescape_lt_in_attrst
quote_charR.Rtuse_trailing_solidustspace_before_trailing_solidusR	tresolve_entitiesR
(R4t
treewalkerR8tin_cdataR=ttokenttypetdoctypeRVtnametattr_namespacet	attr_namet
attr_valuetkt
quote_attrtdatatkey((R@s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyt	serialize�s�						





	

	#
						
	




cC`sE|r%djt|j||���Sdjt|j|���SdS(Ntu(R!tlistRg(R4RZR8((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pytrender1suXXX ERROR MESSAGE NEEDEDcC`s&|jj|�|jr"t�ndS(N(R2RR3tSerializeError(R4Re((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyRM7s	(uquote_attr_valuesu
quote_charuuse_best_quote_charuomit_optional_tagsuminimize_boolean_attributesuuse_trailing_solidususpace_before_trailing_solidusuescape_lt_in_attrsu
escape_rcdatauresolve_entitiesualphabetical_attributesuinject_meta_charsetustrip_whitespaceusanitizeN(t__name__t
__module__RRSRVRR.RHRQRWRXRURORYRJRBRDRFR/R7R9R<tNoneRgRjRM(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyR-Ls4	5		�cC`sdS(uError in serialized treeN((t	Exception((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyRk>s()t
__future__RRRtpip._vendor.sixRtgettextRNt	functoolsRtImportErrort	constantsRRRRR	R
RhRtxml.sax.saxutilsRR!tcodecsR
RR:Rtlentis_ucs4RiRPRcR@RRtislowerR,RR-Rk(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.pyt<module>sD	


	
�

Zerion Mini Shell 1.0