#NEWLINE# def loads( serialized ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# lineno = 0 #NEWLINE# for item in SPLIT_ITEMS ( serialized ) : #NEWLINE# #INDENT# if ( ( not item . startswith ( '#' ) ) and item . strip ( ) ) : #NEWLINE# #INDENT# m = MATCH_ITEM ( item ) #NEWLINE# if ( not m ) : #NEWLINE# #INDENT# raise ValueError ( 'syntax error on line {}' . format ( ( lineno + 1 ) ) ) #NEWLINE# #UNINDENT# value = m . group ( 'value' ) #NEWLINE# value += textwrap . dedent ( ( m . group ( 'value2' ) or '' ) ) #NEWLINE# data [ m . group ( 'key' ) ] = ( value or None ) #NEWLINE# #UNINDENT# lineno += ( item . count ( '\n' ) + 1 ) #NEWLINE# #UNINDENT# return data