feat: draft better debug
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Hazel 2024-04-30 17:24:11 +02:00
parent e93f6d754c
commit 4510520db6

View File

@ -82,10 +82,11 @@ class Collection(Generic[T]):
self._map_element(e)
def _find_object(self, __object: T, no_push_to: bool = False) -> Optional[T]:
if not no_push_to:
if not no_push_to or True:
for c in self.push_to:
found, found_in = c._find_object(__object, no_push_to=True)
if found is not None:
output("push to", found, __object, color=BColors.RED)
return found, found_in
self._remap()
@ -114,10 +115,10 @@ class Collection(Generic[T]):
if map_to is self:
for other, contained in (c._find_object(__object, no_push_to=True) for c in self.pull_from):
output(other, __object, contained, color=BColors.RED)
if other is None:
continue
output("pull from", other, __object, color=BColors.RED)
__object.__merge__(other, no_push_to=False, **kwargs)
contained.remove(other)