File "serializer.cpython-36.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/lib/python3.6/site-packages/pip/_vendor/html5lib/__pycache__/serializer.cpython-36.pyc
File size: 9.07 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

3

Pfa7@sddlmZmZmZddlmZddlZddlmZm	Z	ddl
mZmZm
Z
ddl
mZmZmZddlmZmZdd	lmZd
je
dZejded
ZejdedZiZeddkZxeejD]p\Z Z!eree!dkseree!dkrqe!dkree!dkrej"e!Z!ne#e!Z!e!eks4e j$re ee!<qWddZ%ede%dddZ&Gddde'Z(Gddde)Z*dS))absolute_importdivisionunicode_literals)	text_typeN)register_errorxmlcharrefreplace_errors)voidElementsbooleanAttributesspaceCharacters)rcdataElementsentitiesxmlEntities)treewalkers_utils)escapez"'=<>`[]u_	

 /`  ᠎᠏           

   ]u􏿿&c
Cs"t|ttfrg}g}d}xt|j|j|jD]n\}}|rFd}q4||j}tj|j|t	|j|dgrtj
|j||d}d}nt|}|j|q4Wx^|D]V}t
j|}	|	r|jd|j|	|	jds|jdq|jdt|ddqWdj||jfSt|SdS)NFrTr;z&#x%s;r)
isinstanceUnicodeEncodeErrorUnicodeTranslateError	enumerateobjectstartendrZisSurrogatePairminsurrogatePairToCodepointordappend_encode_entity_mapgetendswithhexjoinr)
excresZ
codepointsskipicindexZ	codepointZcper/ /usr/lib/python3.6/serializer.pyhtmlentityreplace_errors*s0 
"




r1htmlentityreplaceetreecKs$tj|}tf|}|j|||S)N)rZ
getTreeWalkerHTMLSerializerrender)inputZtreeencodingZserializer_optsZwalkersr/r/r0	serializeJs

r9c@s~eZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZd!ZddZddZddZd"ddZd#ddZd$dd ZdS)%r4legacy"TFquote_attr_values
quote_charuse_best_quote_charomit_optional_tagsminimize_boolean_attributesuse_trailing_solidusspace_before_trailing_solidusescape_lt_in_attrs
escape_rcdataresolve_entitiesalphabetical_attributesinject_meta_charsetstrip_whitespacesanitizec	Kszt|t|j}t|dkr2tdtt|d|kr@d|_x(|jD]}t|||j|t	||qHWg|_
d|_dS)a6	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="legacy"|"spec"|"always"
          Whether to quote attribute values that don't require quoting
          per legacy browser behaviour, when required by the standard, or always.
        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
        rz2__init__() got an unexpected keyword argument '%s'r=FN)	frozensetoptionslen	TypeErrornextiterr>setattrr$getattrerrorsstrict)selfkwargsZunexpected_argsattrr/r/r0__init__ps.zHTMLSerializer.__init__cCs*t|tst|jr"|j|jdS|SdS)Nr2)rrAssertionErrorr7encode)rTstringr/r/r0rYszHTMLSerializer.encodecCs*t|tst|jr"|j|jdS|SdS)NrS)rrrXr7rY)rTrZr/r/r0encodeStrictszHTMLSerializer.encodeStrictNccs||_d}g|_|r0|jr0ddlm}|||}|jrJddlm}||}|jrdddlm}||}|j	r~ddl
m}||}|jrddlm}||}xR|D]H}|d}|dkr`d|d}|dr|d	|d7}n|d
r|d7}|d
rJ|d
j
dd
kr0|d
j
dd
kr*|jdd}nd}|d||d
|f7}|d7}|j|Vq|d5kr|dksz|r|r|dj
dd
kr|jd|j|dVn|jt|dVq|d6kr|d}	|jd|	V|	tkr|jrd}n|r|jdx|djD]\\}
}}|}
|}|jdV|j|
V|js|
tj|	tkr"|
tjdtkr"|jdV|jdkst|d
krd}n@|jd krtj|dk	}n$|jd!krtj|dk	}ntd"|jd#d$}|j r|jd%d&}|r|j!}|j"rTd|kr<d|kr<d}nd|krTd|krTd}|dkrl|jdd'}n|jdd(}|j|V|j|V|j|Vn|j|Vq"W|	t#kr|j$r|j%r|jd)Vn|jd*V|jdVq|d+kr6|d}	|	tkrd}n|r$|jd|jd,|	Vq|d-krx|d}|j
d.d
krb|jd/|jd0|dVq|d1kr|d}	|	d2}|t&kr|jd3|	|j'r|t(krt&|}nd4|	}|j|Vq|j|dqWdS)7NFr)FiltertypeZDoctypez<!DOCTYPE %snameZpublicIdz PUBLIC "%s"ZsystemIdz SYSTEMr;r'zASystem identifer contains both single and double quote charactersz %s%s%s>
CharactersSpaceCharactersdataz</zUnexpected </ in CDATAStartTagEmptyTagz<%sTz+Unexpected child element of a CDATA element r=alwaysspecr:z?quote_attr_values must be one of: 'always', 'spec', or 'legacy'rz&amp;<z&lt;z&#39;z&quot;z //ZEndTagz</%s>Commentz--zComment contains --z	<!--%s-->ZEntityrzEntity %s not recognizedz&%s;)rarb)rdre))r7rRrGZfilters.inject_meta_charsetr\rFZfilters.alphabeticalattributesrHZfilters.whitespacerIZfilters.sanitizerr?Zfilters.optionaltagsfindserializeErrorr[rYrrrDitemsr@r
r$tupler<rL_quoteAttributeSpecsearch_quoteAttributeLegacy
ValueErrorreplacerCr=r>r	rArBr
rEr)rT
treewalkerr7Zin_cdatar\tokenr]Zdoctyper=r^_Z	attr_nameZ
attr_valuekvZ
quote_attrrckeyr/r/r0r9s


















zHTMLSerializer.serializecCs2|rdjt|j||Sdjt|j|SdS)Nr)r'listr9)rTrvr7r/r/r0r5?szHTMLSerializer.renderXXX ERROR MESSAGE NEEDEDcCs|jj||jrtdS)N)rRr"rSSerializeError)rTrcr/r/r0rnEszHTMLSerializer.serializeError)r<r=r>r?r@rArBrCrDrErFrGrHrI)N)N)r~)__name__
__module____qualname__r<r=r>r?r@rArBrCrDrErFrGrHrIrKrWrYr[r9r5rnr/r/r/r0r4Qs68


r4c@seZdZdZdS)rzError in serialized treeN)rrr__doc__r/r/r/r0rLsr)r3N)+Z
__future__rrrZpip._vendor.sixrrecodecsrrZ	constantsr	r
rrr
rrrrZxml.sax.saxutilsrr'Z_quoteAttributeSpecCharscompilerqrsr#rLZ_is_ucs4r}roryrzr r!islowerr1r9rr4	Exceptionrr/r/r/r0<module>s:
	

|