#NEWLINE# def roundtrip( self , postings , format , astype ) : #NEWLINE# #INDENT# postfile = self . make_file ( astype ) #NEWLINE# readback = None #NEWLINE# try : #NEWLINE# #INDENT# fpw = FilePostingWriter ( postfile , blocklimit = 8 ) #NEWLINE# fpw . start ( format ) #NEWLINE# for ( id , value ) in postings : #NEWLINE# #INDENT# fpw . write ( id , format . encode ( value ) ) #NEWLINE# #UNINDENT# fpw . close ( ) #NEWLINE# postfile = self . open_file ( astype ) #NEWLINE# fpr = FilePostingReader ( postfile , 0 , format ) #NEWLINE# readback = list ( fpr . all_as ( astype ) ) #NEWLINE# fpr . close ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . delete_file ( self ) #NEWLINE# #UNINDENT# return readback