From cf1f2224b3625b01a6aa7db221403849b308b3bc Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Mon, 29 Nov 2010 00:00:26 -0500 Subject: Making recursive behaviors work. Some bugs existed before. Adding running behavior which makes a signal bounce back and forth. --- LightInstallation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'LightInstallation.py') 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] -- cgit v1.2.3