#NEWLINE# def info_to_dict_multi_level( value , keyname , delimiter1 = ';' , delimiter2 = ':' ) : #NEWLINE# #INDENT# '\n    Simple function to convert string to dict where string is format like\n    field1_section1=value1<delimiter2>field2_section1=value2<delimiter2>... <delimiter1> field1_section2=value3<delimiter2>field2_section2=value4<delimiter2>...\n    ' #NEWLINE# value_list = info_to_list ( value , delimiter1 ) #NEWLINE# value_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for v in v : #NEWLINE# #INDENT# values = info_to_dict ( v , delimiter2 ) #NEWLINE# if ( ( not values ) or isinstance ( values , Exception ) or ( keyname not in values . keys ( ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# value_dict [ values [ keyname ] ] = values #NEWLINE# #UNINDENT# return value_dict