aboutsummaryrefslogtreecommitdiff
path: root/LightInstallation.py
diff options
context:
space:
mode:
authorGravatar Russell Cohen <rcoh@mit.edu>2010-11-29 00:00:26 -0500
committerGravatar Russell Cohen <rcoh@mit.edu>2010-11-29 00:00:26 -0500
commitcf1f2224b3625b01a6aa7db221403849b308b3bc (patch)
tree9ad55077f45efc7a8434688332ee281a28a1cae7 /LightInstallation.py
parent9c9babfa7032b443138c4b457aabaf79fad385b3 (diff)
Making recursive behaviors work. Some bugs existed before. Adding running
behavior which makes a signal bounce back and forth.
Diffstat (limited to 'LightInstallation.py')
-rw-r--r--LightInstallation.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/LightInstallation.py b/LightInstallation.py
index 6866271..7d8b7b0 100644
--- a/LightInstallation.py
+++ b/LightInstallation.py
@@ -14,10 +14,11 @@ class LightInstallation:
self.componentDict = {}
self.inputBehaviorRegistry = {} #inputid -> behaviors listening to that
#input
- #give Util a pointer to our componentRegistry so that everyone can use
+ #give Util a pointer to our componentRegistry and screen so that everyone can use
#it
Util.setComponentDict(self.componentDict)
self.screen = Screen()
+ Util.setScreen(self.screen)
config = Util.loadConfigFile(configFileName)
#read configs from xml
rendererConfig = config.find('RendererConfiguration')
@@ -59,9 +60,8 @@ class LightInstallation:
self.renderers = self.initializeComponent(rendererConfig)
def registerComponents(self, components):
for component in components:
- try:
- cid = component['Id']
- except:
+ cid = component['Id']
+ if cid == None:
raise Exception('Components must have Ids!')
self.componentDict[cid] = component
def initializeComponent(self, config):
@@ -114,7 +114,7 @@ class LightInstallation:
if inputId in self.inputBehaviorRegistry: #it could be a behavior
self.inputBehaviorRegistry[inputId].append(behavior['Id'])
def processResponse(self,inputDict, responseDict):
- #pdb.set_trace()
+ print inputDict, responseDict
inputId = inputDict['Id']
boundBehaviorIds = self.inputBehaviorRegistry[inputId]
[self.componentDict[b].addInput(responseDict) for b in boundBehaviorIds]