def connectDownstream(self, downstream):
self.downstream_elements.append(downstream)
def connectDownstream(self, downstream):
self.downstream_elements.append(downstream)
# we should not disconnect from upstream if
# there are still elements depending on us.
assert len(self.downstream_elements) == 0, "there are still downstream elements left"
# we should not disconnect from upstream if
# there are still elements depending on us.
assert len(self.downstream_elements) == 0, "there are still downstream elements left"
# Sources don't have a source themselves. don't do anything here.
if self.source is not None:
self.source.disconnectDownstream(self)
# Sources don't have a source themselves. don't do anything here.
if self.source is not None:
self.source.disconnectDownstream(self)
def disconnectDownstream(self, downstream):
self.downstream_elements.remove(downstream)
if self.master == downstream:
def disconnectDownstream(self, downstream):
self.downstream_elements.remove(downstream)
if self.master == downstream:
# default action: push downstream
def changed(self, *args, **kwargs):
# default action: push downstream
def changed(self, *args, **kwargs):
def reconnectUpstream(self, new_upstream):
assert self.source is not None
self.source = new_upstream
def reconnectUpstream(self, new_upstream):
assert self.source is not None
self.source = new_upstream
def setSuspend(self, suspended):
changed = self.__suspended != suspended
if not self.__suspended and suspended:
def setSuspend(self, suspended):
changed = self.__suspended != suspended
if not self.__suspended and suspended: