PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  pY@swdZddddddddd d d d d dddddddddgZdZddlZddlZddlZddlZddlZddlm Z Gdd d e Z ddZ GdddZ iddZdd dZdd!d ZeZGd"d d ZGd#ddZejd$d%Zdd&d'Zd(d)Zd*d+d,d-d.d/d0d1d2d3d4d5d6f ZyeeZWnek rYnXd7d8Zd9d:Zd;ed<ed=eiZd>dZd?d;d@d<dAdBdCdDdEdFdGdHdIdJiZee_dKdLZ dMdNZ!dOdPZ"dQdRZ#dddSdTdUdZ$GdVdWdWej%Z&dddSdTdXdZ'dYdZ(ddZd Z)ddd[dZ*Gd\d]d]Z+Gd^d_d_Z,dd`dZ-ddadZ.e-Z/ddbdZ0GdcddZ1GddddZ2ye Z3ddel4TWne5k rrYnXdS)faLightweight XML support for Python. XML is an inherently hierarchical data format, and the most natural way to represent it is with a tree. This module has two classes for this purpose: 1. ElementTree represents the whole XML document as a tree and 2. Element represents a single node in this tree. Interactions with the whole document (reading and writing to/from files) are usually done on the ElementTree level. Interactions with a single XML element and its sub-elements are done on the Element level. Element is a flexible container object designed to store hierarchical data structures in memory. It can be described as a cross between a list and a dictionary. Each Element has a number of properties associated with it: 'tag' - a string containing the element's name. 'attributes' - a Python dictionary storing the element's attributes. 'text' - a string containing the element's text content. 'tail' - an optional string containing text after the element's end tag. And a number of child elements stored in a Python sequence. To create an element instance, use the Element constructor, or the SubElement factory function. You can also use the ElementTree class to wrap an element structure and convert it to and from XML. CommentdumpElement ElementTree fromstringfromstringlist iselement iterparseparse ParseErrorPIProcessingInstructionQName SubElementtostring tostringlist TreeBuilderVERSIONXMLXMLID XMLParserregister_namespacez1.3.0N) ElementPathc@seZdZdZdS)r zAn error when parsing an XML document. In addition to its exception value, a ParseError contains two extra attributes: 'code' - the specific exception code 'position' - the line and column of the error N)__name__ __module__ __qualname____doc__rr*/opt/python35/lib/python3.5/ElementTree.pyr gs cCs t|dS)z2Return True if *element* appears to be an Element.tag)hasattr)elementrrrrusc@seZdZdZdZdZdZdZiddZddZ ddZ d d Z d d Z d dZ ddZddZddZddZddZddZddZddZdd Zdd!d"Zddd#d$Zdd%d&Zdd'd(Zd)d*Zdd+d,Zd-d.Zd/d0Zd1d2Zdd3d4Z dd5d6Z!d7d8Z"dS)9rahAn XML element. This class is the reference implementation of the Element interface. An element's length is its number of subelements. That means if you want to check if an element is truly empty, you should check BOTH its length AND its text attribute. The element tag, attribute names, and attribute values can be either bytes or strings. *tag* is the element name. *attrib* is an optional dictionary containing element attributes. *extra* are additional element attributes given as keyword arguments. Example form: text...tail NcKs`t|ts(td|jjf|j}|j|||_||_g|_ dS)Nzattrib must be dict, not %s) isinstancedict TypeError __class__rcopyupdater attrib _children)selfr r)extrarrr__init__s    zElement.__init__cCs d|jj|jt|fS)Nz<%s %r at %#x>)r&rr id)r+rrr__repr__szElement.__repr__cCs|j||S)zCreate a new element with the same type. *tag* is a string containing the element name. *attrib* is a dictionary containing the element attributes. Do not call this method, use the SubElement factory function instead. )r&)r+r r)rrr makeelements zElement.makeelementcCsD|j|j|j}|j|_|j|_||dd<|S)zReturn copy of current element. This creates a shallow copy. Subelements will be shared with the original tree. N)r0r r)texttail)r+elemrrrr's   z Element.copycCs t|jS)N)lenr*)r+rrr__len__szElement.__len__cCs)tjdtddt|jdkS)NzyThe behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. stacklevelr)warningswarn FutureWarningr4r*)r+rrr__bool__s zElement.__bool__cCs |j|S)N)r*)r+indexrrr __getitem__szElement.__getitem__cCs||j|r?rArCrEr@rIrKrLrOrQrRrSrTrWrXrYr[r^r`rrrrrzs@                 cKs<|j}|j||j||}|j||S)aSubelement factory which creates an element instance, and appends it to an existing parent. The element tag, attribute names, and attribute values can be either bytes or Unicode strings. *parent* is the parent element, *tag* is the subelements name, *attrib* is an optional directory containing element attributes, *extra* are additional attributes given as keyword arguments. )r'r(r0rA)parentr r)r,r"rrrrs   cCstt}||_|S)zComment element factory. This function creates a special element which the standard serializer serializes as an XML comment. *text* is a string containing the comment string. )rrr1)r1r"rrrrs  cCs3tt}||_|r/|jd||_|S)a*Processing Instruction element factory. This function creates a special element which the standard serializer serializes as an XML comment. *target* is a string containing the processing instruction, *text* is a string containing the processing instruction contents, if any.  )rr r1)targetr1r"rrrr s  c@seZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)r aQualified name wrapper. This class can be used to wrap a QName attribute value in order to get proper namespace handing on output. *text_or_uri* is a string containing the QName value either in the form {uri}local, or if the tag argument is given, the URI part of a QName. *tag* is an optional argument which if given, will make the first argument (text_or_uri) be interpreted as a URI, and this argument (tag) be interpreted as a local name. NcCs#|rd||f}||_dS)Nz{%s}%s)r1)r+Z text_or_urir rrrr-szQName.__init__cCs|jS)N)r1)r+rrr__str__sz QName.__str__cCsd|jj|jfS)Nz<%s %r>)r&rr1)r+rrrr/szQName.__repr__cCs t|jS)N)hashr1)r+rrr__hash__szQName.__hash__cCs,t|tr|j|jkS|j|kS)N)r#r r1)r+otherrrr__le__sz QName.__le__cCs,t|tr|j|jkS|j|kS)N)r#r r1)r+rhrrr__lt__ sz QName.__lt__cCs,t|tr|j|jkS|j|kS)N)r#r r1)r+rhrrr__ge__ sz QName.__ge__cCs,t|tr|j|jkS|j|kS)N)r#r r1)r+rhrrr__gt__sz QName.__gt__cCs,t|tr|j|jkS|j|kS)N)r#r r1)r+rhrrr__eq__sz QName.__eq__) rrrrr-rer/rgrirjrkrlrmrrrrr s        c@seZdZdZddddZddZddZdd d Zdd d Zdd dZ dddZ ddddZ dddZ dddZ ddddddddZddZdS)ra%An XML element hierarchy. This class also provides support for serialization to and from standard XML. *element* is an optional root element node, *file* is an optional file handle or file name of an XML file whose contents will be used to initialize the tree with. NcCs ||_|r|j|dS)N)_rootr )r+r"filerrrr-(s zElementTree.__init__cCs|jS)z!Return root element of this tree.)rn)r+rrrgetroot.szElementTree.getrootcCs ||_dS)zReplace root element of this tree. This will discard the current contents of the tree and replace it with the given element. Use with care! N)rn)r+r"rrr_setroot2szElementTree._setrootc Csd}t|ds*t|d}d}z|dkrjt}t|drj|j||_|jSx'|jd}|sP|j|qmW|j|_|jSWd|r|jXdS)a=Load external XML document into element tree. *source* is a file name or file object, *parser* is an optional parser instance that defaults to XMLParser. ParseError is raised if the parser fails to parse the document. Returns the root element of the given source document. FreadrbTN _parse_wholei)r!openrrtrnrrfeedclose)r+sourceparser close_sourcedatarrrr <s&    zElementTree.parsecCs|jj|S)zCreate and return tree iterator for the root element. The iterator loops over all elements in this tree, in document order. *tag* is a string with the tag name to iterate over (default is to return all elements). )rnr[)r+r rrrr[as zElementTree.itercCs)tjdtddt|j|S)NzbThis method will be removed in future versions. Use 'tree.iter()' or 'list(tree.iter())' instead.r6r7)r8r9r\r]r[)r+r rrrr^ns zElementTree.getiteratorcCsM|dddkr:d|}tjd|tdd|jj||S)a\Find first matching element by tag name or path. Same as getroot().find(path), which is Element.find() *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return the first matching element, or None if no element was found. Nr/.zThis search is broken in 1.3 and earlier, and will be fixed in a future version. If you rely on the current behaviour, change it to %rr6r7)r8r9r:rnrL)r+rMrNrrrrLws   zElementTree.findcCsP|dddkr:d|}tjd|tdd|jj|||S)aeFind first matching element by tag name or path. Same as getroot().findtext(path), which is Element.findtext() *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return the first matching element, or None if no element was found. Nrr|r}zThis search is broken in 1.3 and earlier, and will be fixed in a future version. If you rely on the current behaviour, change it to %rr6r7)r8r9r:rnrO)r+rMrPrNrrrrOs   zElementTree.findtextcCsM|dddkr:d|}tjd|tdd|jj||S)aaFind all matching subelements by tag name or path. Same as getroot().findall(path), which is Element.findall(). *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return list containing all matching elements in document order. Nrr|r}zThis search is broken in 1.3 and earlier, and will be fixed in a future version. If you rely on the current behaviour, change it to %rr6r7)r8r9r:rnrQ)r+rMrNrrrrQs   zElementTree.findallcCsM|dddkr:d|}tjd|tdd|jj||S)agFind all matching subelements by tag name or path. Same as getroot().iterfind(path), which is element.iterfind() *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return an iterable yielding all matching elements in document order. Nrr|r}zThis search is broken in 1.3 and earlier, and will be fixed in a future version. If you rely on the current behaviour, change it to %rr6r7)r8r9r:rnrR)r+rMrNrrrrRs   zElementTree.iterfindshort_empty_elementsTcCs7|sd}n|tkr+td||sL|dkrFd}nd}|j}t||}|dkr|s|dkr|d kr|} |dkrddl} | j} |d | f|d krt||jn>t|j|\} } t|} | ||j| | d |WdQRXdS) aWrite element tree to a file as XML. Arguments: *file_or_filename* -- file name or a file object opened for writing *encoding* -- the output encoding (default: US-ASCII) *xml_declaration* -- bool indicating if an XML declaration should be added to the output. If None, an XML declaration is added if encoding IS NOT either of: US-ASCII, UTF-8, or Unicode *default_namespace* -- sets the default XML namespace (for "xmlns") *method* -- either "xml" (default), "html, "text", or "c14n" *short_empty_elements* -- controls the formatting of elements that contain no content. If True (default) they are emitted as a single self-closed tag, otherwise they are emitted as a pair of start/end tags xmlzunknown method %rc14nutf-8us-asciiNunicoderz$ r1r~)rrr) _serialize ValueErrorlower _get_writerlocalegetpreferredencoding_serialize_textrn _namespaces)r+file_or_filenameencodingZxml_declarationdefault_namespacemethodr~Z enc_lowerwriteZdeclared_encodingrqnamesrNZ serializerrrrs2             zElementTree.writecCs|j|ddS)Nrr)r)r+rorrr write_c14n szElementTree.write_c14n)rrrrr-rprqr r[r^rLrOrQrRrrrrrrrs"   %  5ccs|y |j}Wnatk rp|dkr;t|d}nt|dd|dd}| |jVWdQRXYnX|dkr|Vntj}t|tjr|}nt|tjrtj |}|j |j nUtj}dd|_ ||_y|j |_ |j|_Wntk r7YnXtj|d|dddd }|j |j |jVWdQRXdS) NrwrerrorsxmlcharrefreplacecSsdS)NTrrrrr2sz_get_writer..newline )rAttributeErrorru contextlib ExitStackr#ioBufferedIOBase RawIOBaseBufferedWritercallbackdetachwritableseekabletell TextIOWrapper)rrrrostackrrrrs>            rcsddiir"d<fdd}xK|jD]=}|j}t|tr|jkr||jnVt|tr|kr||n.|dk r|tk r|tk rt|xs|j D]e\}}t|tr |j}|kr!||t|tr|jkr||jqW|j}t|trG|jkrG||jqGWfS)Nc sy|dddkr|ddjdd\}}j|}|dkrtj|}|dkrdt}|dkr||<|rd||f|.add_qname) r[r r#r r1r_rr rrY)r3rrr rUrVr1r)rrNrrrDs4     $     rc KsJ|j}|j}|tkr/|d|n|tkrL|d|n||}|dkr|rx|t|x|D]}t|||dd|qWn|d|t|j} | s|r|r0xVt|jdddD]6\} } | rd| } |d | t | fqWxut| D]g\} } t | t ra| j} t | t r|| j} n t | } |d || | fq=W|st |s| r |d |r|t|x'|D]}t|||dd|qW|d |d n |d |j rF|t|j dS)Nz zr~.:z xmlns%s="%s"z %s="%s">z)r r1rr _escape_cdata_serialize_xmlr]rYsorted_escape_attribr#r r4r2) rr3rrNr~kwargsr r1rHrYvkrrrrsT                rZareabaseZbasefontbrcolframehrZimginputZisindexlinkmetaZparamc Ksa|j}|j}|tkr5|dt|n |tkrX|dt|n||}|dkr|r|t|x|D]}t|||dqWn|d|t|j}|s|r|r6xVt|jdddD]6\} } | rd| } |d| t | fqWxut|D]g\} } t | t rg| j} t | t r|| j} n t | } |d || | fqCW|d |j } |r| d ks| d kr||n|t|x!|D]}t|||dqW| tkrA|d |d |jr]|t|jdS)Nz zrrUcSs|dS)Nrr)rrrrrsz!_serialize_html..rz xmlns%s="%s"z %s="%s"rZscriptstyleztd|d||_||_||_d|_|_dS)Nrr)rr_file _close_filerrn)r+rxrryrzrrrr-s  z_IterParseIterator.__init__c Csyxox|jjD]}|SW|jjdkr4P|jjd}|r_|jj|q|jj|_qW|j|_Wn!|jr|jj YnX|jr|jj t dS)Nii@) rrrrrrvrrnrrrw StopIteration)r+rr{rrr__next__s$    z_IterParseIterator.__next__cCs|S)Nr)r+rrr__iter__/sz_IterParseIterator.__iter__N)rrrr-rrrrrrrs  rcCs/|stdt}|j||jS)aParse XML document from string constant. This function can be used to embed "XML Literals" in Python code. *text* is a string containing XML data, *parser* is an optional parser instance, defaulting to the standard XMLParser. Returns an Element instance. rd)rrrvrw)r1ryrrrr3s  cCsw|stdt}|j||j}i}x3|jD]%}|jd}|rD|||.handlerrcSs||||fdS)Nr)r rrArrrrrszstart-nscSs&|||pd|pdffdS)Nrr)rrrrArrrrszend-nscSs||dfdS)Nr)rrrArrrr szunknown event %r) rrAr r rrrrZStartNamespaceDeclHandlerZEndNamespaceDeclHandlerr)r+Z events_queueZevents_to_reportryrAZ event_namerrrrrs(             zXMLParser._seteventscCs7t|}|j|_|j|jf|_|dS)N)r codelinenooffsetZposition)r+rVerrrrr _raiseerrors  zXMLParser._raiseerrorc CsSy|j|}Wn;tk rN|}d|kr=d|}||j|"s)       @04= 2  2            E$K