Ë /†Z1Íœã ó —ddlZddlZddlZddlZ edd„Zdd„Z dd„Z dddd d d d d œZ ejddje eje j«««z«Zdd„Zy#e$r ddlmZYŒmwxYw)éN)Úreducecóp—d|zg}|r|jd«t|||«dj|«S)ay Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a lot of function calls. Each XML element of the content is represented as a list composed of: 1. The name of the element, a string, 2. The attributes of the element, a dictionary (optional), and 3+. The content of the element, if any. Strings are simple text nodes and lists are child elements. Example 1: becomes ['test'] Example 2: This is it! becomes ['myelement', {'a':'value1', 'b':'value2'}, ['childtype', 'This is'], ['childtype', 'it!'], ] Args: content: The structured content to be converted. encoding: The encoding to report on the first XML line. pretty: True if we want pretty printing with indents and new lines. Returns: The XML content as a string. z#Ú Ú)ÚappendÚ_ConstructContentListÚjoin)ÚcontentÚencodingÚprettyÚ xml_partss ú1/usr/lib/python3.12/site-packages/gyp/easy_xml.pyÚ XmlToStringrs@€ðN5°xÑ?Ð@€)Ù Ø ×Ñ�TÔܘ  7¨FÔ3ð �‰�Ó Ðóc óì—|rd|z}d}nd}d}|d}t|t«stdt|«z«‚|j|dz|z«|dd}|r_t|dt«rLt |dj ««D](\}} |jd |›d t| d ¬ «›d �«Œ*|dd}|r§|jd«td„|d «} | } | r|r|j|«|D]>} t| t«r|jt| ««Œ.t|| ||dz«Œ@| r|r|j|«|jd|›d|›�«y|jd|z«y)a+ Appends the XML parts corresponding to the specification. Args: xml_parts: A list of XML parts to be appended to. specification: The specification of the element. See EasyXml docs. pretty: True if we want pretty printing with indents and new lines. level: Indentation level. z rrrzRThe first item of an EasyXml specification should be a string. Specification was Ú<éNÚ z="T)ÚattrÚ"Ú>có*—|xrt|t«S)N)Ú isinstanceÚstr)ÚxÚys rÚz'_ConstructContentList..^s€ aÒ&>¬J°q¼#Ó,>Ð&>rz%s) rrÚ ExceptionrÚdictÚsortedÚitemsÚ _XmlEscaperr) r Ú specificationr ÚlevelÚ indentationÚnew_lineÚnameÚrestÚatÚvalÚ all_stringsÚ multi_lineÚ child_specs rrr@s}€ñ ؘ‘,€KØ�Hà€KØ€HØ �qÑ €$Ü �Dœ#Ô Ü ð4Ü69¸-Ó6HñIó JðJà ×Ñ�; Ñ$ tÑ+Ô,ð �q�rÐ €$Ù Œj˜˜a™¤$Ô'ܘ$˜q™'Ÿ-™-›/Ö*‰ˆˆCØ×Ò¢R¬°C¸dÖ)CÐDÕEð+à ��ˆ8€DÙ Ø ×Ñ�SÔÜÑ>ÀÀdÓK€KØ �€JÙ‘hØ×Ñ�xÔ Ûˆ ô �J¤Ô $Ø×Ñœ  :Ó.Õ/ä˜i¨°V¸UÀQ¹YÕGð ñ‘kØ×Ñ�{Ô#Ø ×Ò¢$©Ð1Õ2à ×Ñ�V˜hÑ&Õ'rcó—t|||«}|r€tjdk7rm|jdd«}t j «d}|rB|j «|j «k7r! |j|«j|«} t|d«}|j«}|j«||k7r.t|d«}|j|«|j«yy#t$rYŒlwxYw#d}YŒIxYw)a: Writes the XML content to disk, touching the file only if it has changed. Args: content: The structured content to be written. path: Location of the file. encoding: The encoding to report on the first line of the XML file. pretty: True if we want pretty printing with indents and new lines. z rrÚrNÚw)rÚosÚlinesepÚreplaceÚlocaleÚgetdefaultlocaleÚupperÚdecodeÚencodeÚAttributeErrorÚopenÚreadÚcloseÚwrite) r Úpathr r Úwin32Ú xml_stringÚdefault_encodingÚfÚexistings rÚWriteXmlIfChangedrDpsô€ô˜7 H¨fÓ5€*Ù Œr�z‰z˜VÒ#Ø×#Ñ# D¨&Ó1€JÜ×.Ñ.Ó0°Ñ3ÐÙÐ,×2Ñ2Ó4¸¿¹Ó8HÒHð Ø×&Ñ&Ð'7Ó8×?Ñ?ÀÓIˆ ð Ü ˆT�3‹€AØ�v‰v‹x€H؇G�G„Ið �ÒÜ ˆT�3‹€A؇G�GˆJÔØ‡G�G…Iðøôò Ù ð ûðØ‚HúsÁ0 C1Â,DÃ1 C=Ã<C=ÄDz"z'z<z>z&z z )rÚ'rrÚ&rÚ z(%s)Ú|có:‡—ˆfd„}tj||«S)z& Escape a string for inclusion in XML.có~•—|j|j«|j«}‰r|dk(r|St|S)NrE)ÚstringÚstartÚendÚ_xml_escape_map)ÚmatchÚmrs €rr3z_XmlEscape..replace¤s8ø€Ø � ‰ �U—[‘[“] U§Y¡Y£[Ð1€Aá ��S’Ø €hÜ ˜1Ñ Ðr)Ú_xml_escape_reÚsub)Úvaluerr3s ` rr"r"¢sø€ôô × Ñ ˜G UÓ +Ð+r)úutf-8F)r)rTFF)F)Úrer1r4ÚsysrÚ NameErrorÚ functoolsrrrDrNÚcompiler ÚmapÚescapeÚkeysrQr"©rrÚr^s¥ðó  Û Û Û ðáó-ó`-(ð`?DØ!ó ðH Ø Ø Ø Ø Ø Ø ñ€ð�—‘Ø ˆS�X‰X‘c˜"Ÿ)™) _×%9Ñ%9Ó%;Ó<Ó =Ñ=ó?€ô,øðkòßðús’A4Á4 BÂB