def dumb_css_parser(data):
 importIndex = data.find('@import')
 while (importIndex != (-1)):
  data = (data[0:importIndex] + data[(data.find(';', importIndex) + 1):])
  importIndex = data.find('@import')
 elements = [x.split('{') for x in data.split('}') if ('{' in x.strip())]
 try:
  elements = dict([(a.strip(), dumb_property_dict(b)) for (a, b) in elements])
 except ValueError:
  elements = {}
 return elements

def dumb_css_parser ( data ) : importIndex = data . find ( '@import' ) while ( importIndex != ( - 1 ) ) : data = ( data [ 0 : importIndex ] + data [ ( data . find ( ';' , importIndex ) + 1 ) : ] ) importIndex = data . find ( '@import' ) elements = [ x . split ( '{' ) for x in data . split ( '}' ) if ( '{' in x . strip ( ) ) ] try : elements = dict ( [ ( a . strip ( ) , dumb_property_dict ( b ) ) for ( a , b ) in elements ] ) except ValueError : elements = { } return elements
returns a hash of css selectors .