#NEWLINE# def __get_table_init( self ) : #NEWLINE# #INDENT# '\n        Return the precalculated CRC table for the table_driven implementation.\n        ' #NEWLINE# if ( self . opt . algorithm != self . opt . algo_table_driven ) : #NEWLINE# #INDENT# return '0' #NEWLINE# #UNINDENT# if ( ( self . opt . width == None ) or ( self . opt . poly == None ) or ( self . opt . reflect_in == None ) ) : #NEWLINE# #INDENT# return '0' #NEWLINE# #UNINDENT# crc = Crc ( width = self . opt . width , poly = self . opt . poly , reflect_in = self . opt . reflect_in , xor_in = 0 , reflect_out = False , xor_out = 0 , table_idx_width = self . opt . tbl_idx_width , slice_by = self . opt . slice_by ) #NEWLINE# crc_tbl = crc . gen_table ( ) #NEWLINE# if ( self . opt . width > 32 ) : #NEWLINE# #INDENT# values_per_line = 4 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . opt . width >= 16 ) : #NEWLINE# #INDENT# values_per_line = 8 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# values_per_line = 16 #NEWLINE# #UNINDENT# #UNINDENT# format_width = max ( out . opt . width , 8 ) #NEWLINE# if ( self . opt . slice_by == 1 ) : #NEWLINE# #INDENT# indent = 4 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# indent = 8 #NEWLINE# #UNINDENT# out = ( [ '' ] * self . opt . slice_by ) #NEWLINE# for i in range ( self . opt . slice_by ) : #NEWLINE# #INDENT# out [ i ] = self . __get_simple_table ( crc_tbl [ i ] , values_per_line , format_width , indent ) #NEWLINE# #UNINDENT# fixed_indent = ( ' ' * ( indent - 4 ) ) #NEWLINE# out = ( ( '{0:s}{{\n' . format ( fixed_indent ) + '\n{0:s}}},\n{0:s}{{\n' . format ( fixed_indent ) . join ( out ) ) + '\n{0:s}}}' . format ( fixed_indent ) ) #NEWLINE# if ( self . opt . slice_by == 1 ) : #NEWLINE# #INDENT# return out #NEWLINE# #UNINDENT# return ( ( '{\n' + out ) + '\n}' )