Ignore:
Timestamp:
13 Sep 2012, 11:12:59 (12 years ago)
Author:
uli
Message:

When creating export CSV files use exporter name for filename.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-async-update/src/waeup/kofa/utils/batching.py

    r9169 r9175  
    518518
    519519    The resulting CSV file will be stored in a new temporary directory
    520     (using :func:`tempfile.mkdtemp`).
     520    (using :func:`tempfile.mkdtemp`). It will be named after the
     521    exporter used with `.csv` filename extension.
    521522
    522523    Returns the path to the created CSV file.
     
    528529    exporter = getUtility(ICSVExporter, name=exporter_name)
    529530    output_dir = tempfile.mkdtemp()
    530     output_path = os.path.join(output_dir, 'export.csv')
     531    filename = '%s.csv' % exporter_name
     532    output_path = os.path.join(output_dir, filename)
    531533    exporter.export_all(site, filepath=output_path)
    532534    return output_path
Note: See TracChangeset for help on using the changeset viewer.