aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Element.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-07-24 23:56:06 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-07-24 23:56:06 +0000
commit9bcc599fba7204b53fc24f2ce7357fe0a85f0dc4 (patch)
treee5e28c024ab2da42f8f8d11132f35a2f4e8c542c /lib/python/Components/Element.py
parent911466bd5e018b80dfbbd5e12c4923e89a980792 (diff)
downloadenigma2-9bcc599fba7204b53fc24f2ce7357fe0a85f0dc4.tar.gz
enigma2-9bcc599fba7204b53fc24f2ce7357fe0a85f0dc4.zip
support only one upstream element (source)
Diffstat (limited to 'lib/python/Components/Element.py')
-rw-r--r--lib/python/Components/Element.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/python/Components/Element.py b/lib/python/Components/Element.py
index 5b8bed86..884c87d3 100644
--- a/lib/python/Components/Element.py
+++ b/lib/python/Components/Element.py
@@ -7,7 +7,6 @@ from Tools.CList import CList
class Element:
def __init__(self):
self.downstream_elements = CList()
- self.upstream_elements = CList()
self.master = None
self.source = None
@@ -17,8 +16,8 @@ class Element:
self.master = downstream
def connectUpstream(self, upstream):
- self.upstream_elements.append(upstream)
- self.source = upstream # for single-source elements (i.e., most of them.)
+ assert self.source is None
+ self.source = upstream
self.changed()
def connect(self, upstream):
@@ -30,10 +29,7 @@ class Element:
# 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"
-
- # disconnect all upstream elements from us
- for upstream in self.upstream_elements:
- upstream.disconnectDownstream(self)
+ self.source.disconnectDownstream(self)
def disconnectDownstream(self, downstream):
self.downstream_elements.remove(downstream)
@@ -46,3 +42,7 @@ class Element:
# default action: push downstream
def changed(self, *args, **kwargs):
self.downstream_elements.changed(*args, **kwargs)
+
+ def reconnectUpstream(self, new_upstream):
+ assert self.source is not None
+ self.source = new_upstream