Changeset 4911
- Timestamp:
- 27 Jan 2010, 21:11:21 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/trunk/src/waeup/utils/batching.py
r4901 r4911 239 239 (base, ext) = os.path.splitext(path) 240 240 failed_path = os.path.join(temp_dir, "%s.pending%s" % (base, ext)) 241 failed_headers = [x for x in mapping.values()]241 failed_headers = mapping.keys() 242 242 failed_headers.append('--ERRORS--') 243 243 failed_writer = csv.DictWriter(open(failed_path, 'wb'), 244 244 failed_headers) 245 failed_writer.writerow(dict([(x,x) for x in failed_headers])) 245 first_row = mapping.items() 246 first_row.append(("--ERRORS--", "--ERRORS--"),) 247 failed_writer.writerow(dict(first_row)) 246 248 247 249 finished_path = os.path.join(temp_dir, "%s.finished%s" % (base, ext)) … … 261 263 if len(conv_warnings): 262 264 num_warns += 1 263 self.writeFailedRow(failed_writer, string_row, conv_warnings)265 self.writeFailedRow(failed_writer, raw_row, conv_warnings) 264 266 continue 265 267 … … 268 270 num_warns += 1 269 271 self.writeFailedRow( 270 failed_writer, string_row,272 failed_writer, raw_row, 271 273 "Not all parents do exist yet. Skipping") 272 274 continue … … 274 276 num_warns += 1 275 277 self.writeFailedRow( 276 failed_writer, string_row,278 failed_writer, raw_row, 277 279 "This object already exists. Skipping.") 278 280 continue … … 285 287 num_warns += 1 286 288 self.writeFailedRow( 287 failed_writer, string_row,289 failed_writer, raw_row, 288 290 "Cannot remove: no such entry.") 289 291 continue … … 294 296 num_warns += 1 295 297 self.writeFailedRow( 296 failed_writer, string_row,298 failed_writer, raw_row, 297 299 "Cannot update: no such entry.") 298 300 continue
Note: See TracChangeset for help on using the changeset viewer.