def _getStyle(node):
 if ((node.nodeType == 1) and (len(node.getAttribute('style')) > 0)):
  styleMap = {}
  rawStyles = node.getAttribute('style').split(';')
  for style in rawStyles:
   propval = style.split(':')
   if (len(propval) == 2):
    styleMap[propval[0].strip()] = propval[1].strip()
  return styleMap
 else:
  return {}

def _getStyle ( node ) : if ( ( node . nodeType == 1 ) and ( len ( node . getAttribute ( 'style' ) ) > 0 ) ) : styleMap = { } rawStyles = node . getAttribute ( 'style' ) . split ( ';' ) for style in rawStyles : propval = style . split ( ':' ) if ( len ( propval ) == 2 ) : styleMap [ propval [ 0 ] . strip ( ) ] = propval [ 1 ] . strip ( ) return styleMap else : return { }
returns the style attribute of a node as a dictionary .