Changeset 6243 for main/waeup.sirp/trunk/src/waeup/sirp/utils
- Timestamp:
- 30 May 2011, 07:15:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py
r6219 r6243 15 15 from zope.schema import getFields 16 16 from waeup.sirp.interfaces import ( 17 IBatchProcessor, ISchemaTypeConverter, FatalCSVError )17 IBatchProcessor, ISchemaTypeConverter, FatalCSVError, DuplicationError) 18 18 19 19 class BatchProcessor(grok.GlobalUtility): … … 282 282 continue 283 283 obj = self.callFactory() 284 #import pdb; pdb.set_trace()285 284 for key, value in row.items(): 286 285 setattr(obj, key, value) 287 if not self.addEntry(obj, row, site): 288 num_warns += 1 289 self.writeFailedRow( 290 failed_writer, raw_row, 291 "This object code already exists somewhere else. Skipping.") 286 try: 287 self.addEntry(obj, row, site) 288 except DuplicationError, error: 289 num_warns += 1 290 self.writeFailedRow( 291 failed_writer, raw_row, 292 "%s Skipping." % error.msg) 292 293 continue 293 294 elif mode == 'remove':
Note: See TracChangeset for help on using the changeset viewer.