def makeLayer(element):
 kwargs = {}
 if element.hasAttribute('src'):
  kwargs['layername'] = element.getAttribute('src')
 if element.hasAttribute('color'):
  kwargs['colorname'] = element.getAttribute('color')
 for child in element.childNodes:
  if (child.nodeType == child.ELEMENT_NODE):
   if ((child.tagName == 'mask') and child.hasAttribute('src')):
    kwargs['maskname'] = child.getAttribute('src')
 print >>sys.stderr, 'Making a layer from', kwargs
 return Layer(**kwargs)

def makeLayer ( element ) : kwargs = { } if element . hasAttribute ( 'src' ) : kwargs [ 'layername' ] = element . getAttribute ( 'src' ) if element . hasAttribute ( 'color' ) : kwargs [ 'colorname' ] = element . getAttribute ( 'color' ) for child in element . childNodes : if ( child . nodeType == child . ELEMENT_NODE ) : if ( ( child . tagName == 'mask' ) and child . hasAttribute ( 'src' ) ) : kwargs [ 'maskname' ] = child . getAttribute ( 'src' ) print >> sys . stderr , 'Making a layer from' , kwargs return Layer ( ** kwargs )
build a layer object from an xml element .