equal
deleted
inserted
replaced
292 """iterates over the item's children""" |
292 """iterates over the item's children""" |
293 if _done is None: |
293 if _done is None: |
294 _done = set() |
294 _done = set() |
295 for child in self.children(): |
295 for child in self.children(): |
296 if child.eid in _done: |
296 if child.eid in _done: |
297 self.error('loop in %s tree', child.__regid__.lower()) |
297 self.error('loop in %s tree: %s', child.__regid__.lower(), child) |
298 continue |
298 continue |
299 yield child |
299 yield child |
300 _done.add(child.eid) |
300 _done.add(child.eid) |
301 |
301 |
302 @implements_adapter_compat('ITree') |
302 @implements_adapter_compat('ITree') |
318 path = [] |
318 path = [] |
319 adapter = self |
319 adapter = self |
320 entity = adapter.entity |
320 entity = adapter.entity |
321 while entity is not None: |
321 while entity is not None: |
322 if entity.eid in path: |
322 if entity.eid in path: |
323 self.error('loop in %s tree', entity.__regid__.lower()) |
323 self.error('loop in %s tree: %s', entity.__regid__.lower(), entity) |
324 break |
324 break |
325 path.append(entity.eid) |
325 path.append(entity.eid) |
326 try: |
326 try: |
327 # check we are not jumping to another tree |
327 # check we are not jumping to another tree |
328 if (adapter.tree_relation != self.tree_relation or |
328 if (adapter.tree_relation != self.tree_relation or |