(headers, data, file, format=Format.XLS_2007,
                         max_column_size=2000, separator='|')
exposing export_raw as a context manager gives the caller the opportunity
    to interact with `writer` before it is closed. The caller could, for example,
    add excel styling or excel properties.
exposing export_raw as a context manager gives the caller the opportunity
    to interact with `writer` before it is closed. The caller could, for example,
    add excel styling or excel properties.
exposing export_raw as a context manager gives the caller the opportunity to interact with writer before it is closed . The caller could for example add excel styling or excel properties .
def export_raw_to_writer(headers, data, file, format=Format.XLS_2007,
                         max_column_size=2000, separator='|'):
    """
    exposing export_raw as a context manager gives the caller the opportunity
    to interact with `writer` before it is closed. The caller could, for example,
    add excel styling or excel properties.

    """
    # transform docs onto output and save
    writer = get_writer(format)

    # format the headers the way the export likes them
    headers = FormattedRow.wrap_all_rows(headers)
    writer.open(headers, file, max_column_size=max_column_size)

    # do the same for the data
    data = FormattedRow.wrap_all_rows(data)
    writer.write(data)
    yield writer
    writer.close()
def export_raw_to_writer ( headers , data , file , format = Format . XLS_2007 , max_column_size = 2000 , separator = '|' ) : # transform docs onto output and save writer = get_writer ( format ) # format the headers the way the export likes them headers = FormattedRow . wrap_all_rows ( headers ) writer . open ( headers , file , max_column_size = max_column_size ) # do the same for the data data = FormattedRow . wrap_all_rows ( data ) writer . write ( data ) yield writer writer . close ( )