#NEWLINE# def __str__( self ) : #NEWLINE# #INDENT# ( fields , fmts ) = self . opt_fields_fmts ( ) #NEWLINE# if fields : #NEWLINE# #INDENT# vals = [ ] #NEWLINE# for f in fields : #NEWLINE# #INDENT# vals . append ( getattr ( self , f ) ) #NEWLINE# #UNINDENT# opt_s = struct . pack ( '' . join ( fmts ) , * vals ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# opt_s = '' #NEWLINE# #UNINDENT# return ( ( ( self . pack_hdr ( ) + opt_s ) + '' . join ( map ( str , self . sre ) ) ) + str ( self . data ) )