def parseAttributes(attrStr=None):
 attrs = {}
 if (attrStr is not None):
  for token in attrStr.split():
   if ('=' in token):
    (key, value) = token.split('=', 1)
   else:
    (key, value) = (token, 1)
   attrs[key] = value
 return attrs

def parseAttributes ( attrStr = None ) : attrs = { } if ( attrStr is not None ) : for token in attrStr . split ( ) : if ( '=' in token ) : ( key , value ) = token . split ( '=' , 1 ) else : ( key , value ) = ( token , 1 ) attrs [ key ] = value return attrs
parse the given attributes string into an attribute dict .