Ignore:
Timestamp:
29 Sep 2011, 07:54:36 (13 years ago)
Author:
Henrik Bettermann
Message:

We use the same headers for failed and finished files. Both files get the modified headers not the original headers which were obviously wrong.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py

    r6828 r6831  
    230230        (base, ext) = os.path.splitext(base)
    231231        failed_path = os.path.join(temp_dir, "%s.pending%s" % (base, ext))
    232         failed_headers = mapping.keys()
     232        failed_headers = mapping.values()
    233233        failed_headers.append('--ERRORS--')
    234234        failed_writer = csv.DictWriter(open(failed_path, 'wb'),
    235235                                       failed_headers)
    236         first_row = mapping.items()
    237         first_row.append(("--ERRORS--", "--ERRORS--"),)
    238         failed_writer.writerow(dict(first_row))
     236        failed_writer.writerow(dict([(x,x) for x in failed_headers]))
    239237
    240238        finished_path = os.path.join(temp_dir, "%s.finished%s" % (base, ext))
    241         finished_headers = [x for x in mapping.values()]
     239        finished_headers = mapping.values()
    242240        finished_writer = csv.DictWriter(open(finished_path, 'wb'),
    243241                                         finished_headers)
Note: See TracChangeset for help on using the changeset viewer.