#NEWLINE# def parse_prop_file( filename , key ) : #NEWLINE# #INDENT# found = False #NEWLINE# f = open ( filename , 'rt' ) #NEWLINE# data = '' #NEWLINE# try : #NEWLINE# #INDENT# for line in iter ( f . readline , '' ) : #NEWLINE# #INDENT# parts = line . split ( ) #NEWLINE# if ( len ( parts ) == 2 ) : #NEWLINE# #INDENT# ( kind , length ) = parts #NEWLINE# data = f . read ( int ( length ) ) #NEWLINE# if ( ( kind == 'K' ) and ( data == key ) ) : #NEWLINE# #INDENT# found = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( kind == 'V' ) and found ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( ) #NEWLINE# #UNINDENT# return data