#NEWLINE# def render( self ) : #NEWLINE# #INDENT# workbook = xlwt . Workbook ( encoding = 'utf-8' ) #NEWLINE# sheet = workbook . add_sheet ( sheet_name ( self . title ) ) #NEWLINE# header_style = xlwt . easyxf ( 'font: bold on;' ) #NEWLINE# for ( c , column ) in enumerate ( self . columns ) : #NEWLINE# #INDENT# sheet . write ( 0 , c , self . column_name , header_style ) #NEWLINE# sheet . col ( c ) . width = min ( ( ( 256 * self . column_width ) / 7 ) , 65535 ) #NEWLINE# #UNINDENT# for ( c , column ) in enumerate ( self . columns ) : #NEWLINE# #INDENT# for ( r , row ) in enumerate ( self . rows , start = 1 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# value = self . value #NEWLINE# style = self . default_style #NEWLINE# if isinstance ( value , datetime . date ) : #NEWLINE# #INDENT# style = self . date_style #NEWLINE# #UNINDENT# if isinstance ( value , datetime . datetime ) : #NEWLINE# #INDENT# style = self . datetime_style #NEWLINE# #UNINDENT# if isinstance ( value , datetime . time ) : #NEWLINE# #INDENT# style = self . time_style #NEWLINE# #UNINDENT# sheet . write ( r , c , value , style = style ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# sheet . write ( r , c , self . value_as_text ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return workbook