equal
deleted
inserted
replaced
337 pass |
337 pass |
338 |
338 |
339 def rql(self, *args): |
339 def rql(self, *args): |
340 if self._rql is not None: |
340 if self._rql is not None: |
341 return self._rql(*args) |
341 return self._rql(*args) |
|
342 return [] |
342 |
343 |
343 @property |
344 @property |
344 def nb_inserted_entities(self): |
345 def nb_inserted_entities(self): |
345 return len(self.eids) |
346 return len(self.eids) |
346 @property |
347 @property |
468 |
469 |
469 def relate(self, eid_from, rtype, eid_to, inlined=False): |
470 def relate(self, eid_from, rtype, eid_to, inlined=False): |
470 eid_from, rtype, eid_to = super(RQLObjectStore, self).relate( |
471 eid_from, rtype, eid_to = super(RQLObjectStore, self).relate( |
471 eid_from, rtype, eid_to) |
472 eid_from, rtype, eid_to) |
472 self.rql('SET X %s Y WHERE X eid %%(x)s, Y eid %%(y)s' % rtype, |
473 self.rql('SET X %s Y WHERE X eid %%(x)s, Y eid %%(y)s' % rtype, |
473 {'x': int(eid_from), 'y': int(eid_to)}, ('x', 'y')) |
474 {'x': int(eid_from), 'y': int(eid_to)}) |
474 |
475 |
475 |
476 |
476 # the import controller ######################################################## |
477 # the import controller ######################################################## |
477 |
478 |
478 class CWImportController(object): |
479 class CWImportController(object): |
511 tmp = StringIO() |
512 tmp = StringIO() |
512 if type is None: |
513 if type is None: |
513 traceback.print_exc(file=tmp) |
514 traceback.print_exc(file=tmp) |
514 else: |
515 else: |
515 traceback.print_exception(type, value, tb, file=tmp) |
516 traceback.print_exception(type, value, tb, file=tmp) |
516 print tmp.getvalue() |
|
517 # use a list to avoid counting a <nb lines> errors instead of one |
517 # use a list to avoid counting a <nb lines> errors instead of one |
518 errorlog = self.errors.setdefault(key, []) |
518 errorlog = self.errors.setdefault(key, []) |
519 if msg is None: |
519 if msg is None: |
520 errorlog.append(tmp.getvalue().splitlines()) |
520 errorlog.append(tmp.getvalue().splitlines()) |
521 else: |
521 else: |