#NEWLINE# def write( dictionary , args , output_file_path ) : #NEWLINE# #INDENT# csv_fs = escape ( args . csv_fs ) #NEWLINE# csv_ls = escape ( output_file_obj . csv_ls ) #NEWLINE# try : #NEWLINE# #INDENT# print_debug ( ( "Writing to file '%s'..." % output_file_path ) , args . debug ) #NEWLINE# output_file_obj = open ( output_file_path , 'wb' ) #NEWLINE# for index in dictionary . entries_index_sorted : #NEWLINE# #INDENT# entry = dictionary . entries [ index ] #NEWLINE# string = ( '%s%s%s%s' % ( entry . headword , csv_fs , entry . definition , csv_ls ) ) #NEWLINE# output_file_obj . write ( string . encode ( 'utf-8' ) ) #NEWLINE# #UNINDENT# output_file_obj . close ( ) #NEWLINE# print_debug ( ( "Writing to file '%s'... success" % output_file_path ) , args . debug ) #NEWLINE# return [ output_file_path ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# print_error ( ( "Writing to file '%s'... failure" % output_file_path ) ) #NEWLINE# return None