%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/utils/xmlutil.pyo

�
���^c@@sMdZddlmZmZmZd�Zd�Zd�Zed�Z	dS(u
Various XML utilities
i(tabsolute_importtprint_functiontunicode_literalscC@s-d|kr)|jd�}|d}|S|S(u�
    If this XML tree has an xmlns attribute, then etree will add it
    to the beginning of the tag, like: "{http://path}tag".
    u}i(tsplit(txtcompstname((s6/usr/lib/python2.7/site-packages/salt/utils/xmlutil.pyt
_conv_name
s

cC@s�t|j��dkr5t|j�}i|j|6Si}x�|D]�}t|j�}||kr�t|j��dkr�t|�||<q�|j||<qBt||t�s�||g||<n||jt|��qBW|S(u�
    Converts an XML ElementTree to a dictionary that only contains items.
    This is the default behavior in version 2017.7. This will default to prevent
    unexpected parsing issues on modules dependant on this.
    ii(	tlentgetchildrenRttagttextt_to_dictt
isinstancetlisttappend(txmltreeRtxmldicttitem((s6/usr/lib/python2.7/site-packages/salt/utils/xmlutil.pyRs
cC@si}x'|jj�D]\}}|||<qWt|j��dkr�t|�dkra|jS|jr�|j|t|j�<q�nxz|D]r}t|j�}||kr�t|�||<q�t||t	�s�||g||<n||j
t|��q�W|S(u?
    Returns the full XML dictionary including attributes.
    ii(tattribtitemsRR	RRR
t
_to_full_dictR
RR(RRtattrNamet	attrValueRR((s6/usr/lib/python2.7/site-packages/salt/utils/xmlutil.pyR5s 	
cC@s|rt|�St|�SdS(u�
    Convert an XML tree into a dict. The tree that is passed in must be an
    ElementTree object.
    Args:
        xmltree: An ElementTree object.
        attr: If true, attributes will be parsed. If false, they will be ignored.

    N(RR(Rtattr((s6/usr/lib/python2.7/site-packages/salt/utils/xmlutil.pytto_dictYs	
N(
t__doc__t
__future__RRRRRRtFalseR(((s6/usr/lib/python2.7/site-packages/salt/utils/xmlutil.pyt<module>s
			$

Zerion Mini Shell 1.0