daemon/core/misc/xmlutils.py
def addtextelementsfromtuples(dom, parent, iterable, attrs=()):
    ''' XML helper to iterate through a list of tuples and add items to
    parent using tags named for the first tuple element,
    attributes specified in the attrs tuple, and having the
    text of second tuple element.
    Example: addtextelementsfromtuples(dom, parent,
                 (('first','a'),('second','b'),('third','c')),
                 (('show','True'),))
    <parent>
      <first show="True">a</first>
      <second show="True">b</second>
      <third show="True">c</third>
    </parent>
    '''
    for name, value in iterable:
        element = dom.createElement(name)
        for k,v in attrs:
            element.setAttribute(k, v)
        parent.appendChild(element)
        txt = dom.createTextNode(value)
        element.appendChild(txt)
 XML helper to iterate through a list of tuples and add items to
    parent using tags named for the first tuple element,
    attributes specified in the attrs tuple, and having the
    text of second tuple element.
    Example: addtextelementsfromtuples(dom, parent,
                 (('first','a'),('second','b'),('third','c')),
                 (('show','True'),))
    <parent>
      <first show="True">a</first>
      <second show="True">b</second>
      <third show="True">c</third>
    </parent>
    
XML helper to iterate through a list of tuples and add items to
parent using tags named for the first tuple element,
attributes specified in the attrs tuple, and having the
text of second tuple element.
XML helper to iterate through a list of tuples and add items to parent using tags named for the first tuple element attributes specified in the attrs tuple and having the text of second tuple element .
def addtextelementsfromtuples(dom, parent, iterable, attrs=()):
    for name, value in iterable:
        element = dom.createElement(name)
        for k,v in attrs:
            element.setAttribute(k, v)
        parent.appendChild(element)
        txt = dom.createTextNode(value)
        element.appendChild(txt)
def addtextelementsfromtuples ( dom , parent , iterable , attrs = ( ) ) : for name , value in iterable : element = dom . createElement ( name ) for k , v in attrs : element . setAttribute ( k , v ) parent . appendChild ( element ) txt = dom . createTextNode ( value ) element . appendChild ( txt )
XML helper to iterate through a list of tuples and add items to
parent using tags named for the first tuple element,
attributes specified in the attrs tuple, and having the
text of second tuple element.
XML helper to iterate through a list of tuples and add items to parent using tags named for the first tuple element attributes specified in the attrs tuple and having the text of second tuple element .
''' XML helper to iterate through a list of tuples and add items to
    parent using tags named for the first tuple element,
    attributes specified in the attrs tuple, and having the
    text of second tuple element.
    Example: addtextelementsfromtuples(dom, parent,
                 (('first','a'),('second','b'),('third','c')),
                 (('show','True'),))
    <parent>
      <first show="True">a</first>
      <second show="True">b</second>
      <third show="True">c</third>
    </parent>
    '''
dom
parent
iterable
attrs