#NEWLINE# def prepare( self , record ) : #NEWLINE# #INDENT# ' Write the header in the csv file the first time it is called. ' #NEWLINE# if ( not self . _ready ) : #NEWLINE# #INDENT# if hasattr ( record , '_fields' ) : #NEWLINE# #INDENT# self . _writer . writerow ( record . _fields ) #NEWLINE# #UNINDENT# self . _ready = True