#NEWLINE# def parse_struct( self , fmt , f ) : #NEWLINE# #INDENT# l = [ ] #NEWLINE# i = 0 #NEWLINE# while ( i < len ( fmt ) ) : #NEWLINE# #INDENT# c = fmt [ i ] #NEWLINE# if ( c == '[' ) : #NEWLINE# #INDENT# end = fmt . find ( ']' , i ) #NEWLINE# if ( end < 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'no closing ] character' ) #NEWLINE# #UNINDENT# subfmt = fmt [ ( i + 1 ) : end ] #NEWLINE# count = self . array_count_parse_f ( f ) #NEWLINE# array = [ ] #NEWLINE# for j in range ( count ) : #NEWLINE# #INDENT# if ( len ( subfmt ) == 1 ) : #NEWLINE# #INDENT# array . append ( parse_struct ( subfmt , f ) [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# array . append ( parse_struct ( subfmt , f ) ) #NEWLINE# #UNINDENT# #UNINDENT# l . append ( tuple ( array ) ) #NEWLINE# i = end #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# l . append ( self . parse_lookup [ c ] ( f ) ) #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# return tuple ( l )