From 5783d6336f014c05e0e46d7bc35533e70b280582 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 25 Nov 2010 21:44:00 -0500 Subject: Added BehaviorChain to support chains of behaviors. Added FollowMouse parameter to PygameInput to support following of mice. Added component registry to Util which allows any component to access any other component. Some changes to the structure of LightInstallation. --- operationscore/Input.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'operationscore/Input.py') diff --git a/operationscore/Input.py b/operationscore/Input.py index 1ba4528..67a7bb0 100644 --- a/operationscore/Input.py +++ b/operationscore/Input.py @@ -13,14 +13,22 @@ class Input(threading.Thread): self.eventQueue = [] self.parentScope = argDict['parentScope'] self.argDict = argDict - if not 'InputId' in argDict: - raise Exception('InputId must be defined in config xml') if not 'RefreshInterval' in argDict: print 'RefreshInterval not defined. Defaulting to .5s.' self.argDict['RefreshInterval'] = 500 self.inputInit() threading.Thread.__init__(self) self.daemon = True #This kills this thread when the main thread stops + #CHEATING until I can get multiple inheritence working + def __setitem__(self,k, item): + self.argDict[k] = item + def __getitem__(self, item): + if item in self.argDict: + return self.argDict[item] + else: + return None + def __getiter__(self): + return self.argDict.__getiter__() def respond(self, eventDict): #if eventDict != []: #pdb.set_trace() -- cgit v1.2.3