Viewing File: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyo
ó
-ÎP`c @ sZ d d l m Z d „ Z d e f d „ ƒ YZ d „ Z d „ Z d „ Z e d „ Z d S(
iÿÿÿÿ( t ElementTreec C s | | j d ƒ d S( Nt }i ( t find( t tag( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyt _ns
s t
XmlDictObjectc B s\ e Z d Z d d „ Z d „ Z d „ Z d „ Z e d „ ƒ Z e d „ ƒ Z
d „ Z RS( sD
Adds object like functionality to the standard dictionary.
c C s) | d k r i } n t j | | ƒ d S( N( t Nonet dictt __init__( t selft initdict( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyR s c C s
| j | ƒ S( N( t __getitem__( R t item( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyt __getattr__ s c C s | j | | ƒ d S( N( t __setitem__( R R t value( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyt __setattr__ s c C s! d | k r | j d ƒ Sd Sd S( Nt _textt ( R ( R ( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyt __str__ s
c C s` t | t ƒ r) t d „ | j ƒ Dƒ ƒ St | t ƒ rX g | D] } t j | ƒ ^ q? S| Sd S( sT
Static method to wrap a dictionary recursively as an XmlDictObject
c s s* | ] \ } } | t j | ƒ f Vq d S( N( R t wrap( t .0t kt v( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pys <genexpr>* s N( t
isinstanceR R t itemst listR ( t xR ( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyR # s c C s` t | t ƒ r) t d „ | j ƒ Dƒ ƒ St | t ƒ rX g | D] } t j | ƒ ^ q? S| Sd S( Nc s s* | ] \ } } | t j | ƒ f Vq d S( N( R t _un_wrap( R R R ( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pys <genexpr>4 s ( R R R R R R ( R R ( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyR 0 s c C s
t j | ƒ S( sp
Recursively converts an XmlDictObject to a standard dictionary and
returns the result.
( R R ( R ( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyt un_wrap: s N( t __name__t
__module__t __doc__R R R
R R t staticmethodR R R ( ( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyR s
c C sÛ t | t ƒ rÈ xÅ | j ƒ D]¥ \ } } t | ƒ d k rL t | ƒ | _ q t | t ƒ r˜ xc | D]/ } t j | ƒ } | j | ƒ t | | ƒ qb Wq t j | ƒ } | j | ƒ t | | ƒ q Wn t | ƒ | _ d S( NR (
R R R t strt textR R t Elementt appendt _convert_dict_to_xml_recurse( t parentt dictitemR t childt listchildt elem( ( s: /usr/lib/python2.7/site-packages/lsm/external/xmltodict.pyR&