- Timestamp:
- 21 Sep 2012, 08:19:35 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/uli-async-update removed /main/waeup.kofa/branches/uli-autoinclude-less removed /main/waeup.kofa/trunk removed
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/utils/batching.py
r9209 r9211 304 304 finished_writer = csv.DictWriter(open(finished_path, 'wb'), 305 305 finished_headers) 306 os.chmod(finished_path, 0664)307 306 finished_writer.writerow(dict([(x,x) for x in finished_headers])) 308 307 … … 399 398 os.path.abspath(finished_path), failed_path) 400 399 401 def get_csv_skeleton(self):402 """Export CSV file only with a header of available fields.403 404 A raw string with CSV data should be returned.405 """406 outfile = StringIO()407 writer = csv.DictWriter(outfile, self.available_fields)408 writer.writerow(dict(zip(self.available_fields, self.available_fields))) # header409 outfile.seek(0)410 return outfile.read()411 412 400 class ExporterBase(object): 413 401 """A base for exporters. … … 518 506 519 507 The resulting CSV file will be stored in a new temporary directory 520 (using :func:`tempfile.mkdtemp`). It will be named after the 521 exporter used with `.csv` filename extension. 508 (using :func:`tempfile.mkdtemp`). 522 509 523 510 Returns the path to the created CSV file. … … 529 516 exporter = getUtility(ICSVExporter, name=exporter_name) 530 517 output_dir = tempfile.mkdtemp() 531 filename = '%s.csv' % exporter_name 532 output_path = os.path.join(output_dir, filename) 518 output_path = os.path.join(output_dir, 'export.csv') 533 519 exporter.export_all(site, filepath=output_path) 534 520 return output_path
Note: See TracChangeset for help on using the changeset viewer.