#NEWLINE# def write( self , fh ) : #NEWLINE# #INDENT# if ( not isinstance ( fh , file ) ) : #NEWLINE# #INDENT# fh = open ( fh , 'wb' ) #NEWLINE# #UNINDENT# def print_chunks( chunks ) : #NEWLINE# #INDENT# for chunk in chunks : #NEWLINE# #INDENT# fh . write ( str ( chunk ) ) #NEWLINE# if ( chunk . header in ( 'RIFF' , 'LIST' ) ) : #NEWLINE# #INDENT# print_chunks ( chunk . chunks ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# print_chunks ( self . chunks ) #NEWLINE# fh . close ( ) #NEWLINE# self . close ( )