Migrates the objects in the ist objs Definition at line 81 of file Walker.py. 00081 : """Migrates the objects in the ist objs """ for obj in objs: msg=('Migrating %s from %s to %s ... ' % ('/'.join(obj.getPhysicalPath()), self.fromType, self.toType, )) LOG(msg) self.out.append(msg) #print msg migrator = self.migrator(obj, **kwargs) try: # run the migration migrator.migrate() except Exception, err: # except all! # aborting transaction get_transaction().abort() # printing exception exc = sys.exc_info() out=StringIO.StringIO() traceback.print_tb(exc[2], limit=None, file=out) tb = '%s\n%s\n' % (err, out.getvalue()) error = MigrationError(obj, migrator, tb) msg = str(error) LOG(msg) self.out[-1]+=msg print msg # stop migration process after an error # the transaction was already aborted by the migrator itself raise MigrationError(obj, migrator, tb) else: LOG('done') self.out[-1]+='done' if self.subtransaction and \ (len(self.out) % self.subtransaction) == 0: # submit a subtransaction after every X (default 30) # migrated objects to safe your butt get_transaction().commit(1) LOG('comitted...') def getOutput(self):
|