diff options
author | rcoh <rcoh@mit.edu> | 2011-01-04 10:43:21 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-01-04 10:43:21 -0500 |
commit | dcc7afcea31c968575446b7f215d6780f747d7fb (patch) | |
tree | 52591d98be214371d96795f4995e637ce95d7759 /operationscore | |
parent | f5c29b39f3eef83227e3fb7c550d9b2922a19894 (diff) | |
parent | 134de4472d3f2fa913944770595de9221dd27fdf (diff) |
Merge branch 'bens-cleanup' of github.com:rcoh/SmootLight
Conflicts:
operationscore/Input.py
pixelevents/DecayEvent.py
util/ColorOps.py
Diffstat (limited to 'operationscore')
-rw-r--r-- | operationscore/Input.py | 4 | ||||
-rw-r--r-- | operationscore/Renderer.py | 4 | ||||
-rw-r--r-- | operationscore/SmootCoreObject.py | 3 | ||||
-rw-r--r-- | operationscore/ThreadedSmootCoreObject.py | 14 |
4 files changed, 19 insertions, 6 deletions
diff --git a/operationscore/Input.py b/operationscore/Input.py index 9e8841a..3dd74cf 100644 --- a/operationscore/Input.py +++ b/operationscore/Input.py @@ -1,6 +1,6 @@ import threading,time -from operationscore.SmootCoreObject import * from logger import main_log, exception_log +from operationscore.ThreadedSmootCoreObject import ThreadedSmootCoreObject #Abstract class for inputs. Inheriting classes should call "respond" to raise #their event. Inheriting classes MUST define sensingLoop. Called at the #interval specified in RefreshInterval while the input is active. For example, if you are writing @@ -8,7 +8,7 @@ from logger import main_log, exception_log #Inheriting classes MAY define inputInit. This is called before the loop #begins. import pdb -class Input(SmootCoreObject): +class Input(ThreadedSmootCoreObject): #Event scope is a function pointer the function that will get called when #an Parent is raised. def __init__(self, argDict): diff --git a/operationscore/Renderer.py b/operationscore/Renderer.py index 8e31f8b..88da606 100644 --- a/operationscore/Renderer.py +++ b/operationscore/Renderer.py @@ -3,8 +3,8 @@ #Inheriting classes may define initRenderer which is called after the dictionary #is pulled from config. #TODO: multithreaded-rendering -from operationscore.SmootCoreObject import * -class Renderer(SmootCoreObject): +from operationscore.ThreadedSmootCoreObject import * +class Renderer(ThreadedSmootCoreObject): def init(self): self.initRenderer() threading.Thread.__init__(self) diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py index 26b3fc2..291519a 100644 --- a/operationscore/SmootCoreObject.py +++ b/operationscore/SmootCoreObject.py @@ -2,12 +2,11 @@ import pdb import threading import thread import util.Config as configGetter -class SmootCoreObject(threading.Thread): +class SmootCoreObject(object): def __init__(self, argDict, skipValidation = False): self.argDict = argDict self.validateArgs(self.className()+'.params') self.lock = thread.allocate_lock() - threading.Thread.__init__(self) self.init() #call init of inheriting class # self.__setitem__ = self.argDict.__setitem__ # self.__getitem__ = self.argDict.__getitem__ diff --git a/operationscore/ThreadedSmootCoreObject.py b/operationscore/ThreadedSmootCoreObject.py new file mode 100644 index 0000000..90611bc --- /dev/null +++ b/operationscore/ThreadedSmootCoreObject.py @@ -0,0 +1,14 @@ +import pdb +import threading +import thread +import util.Config as configGetter +from operationscore.SmootCoreObject import SmootCoreObject +class ThreadedSmootCoreObject(SmootCoreObject, threading.Thread): + def __init__(self, argDict, skipValidation = False): + self.argDict = argDict + self.validateArgs(self.className()+'.params') + self.lock = thread.allocate_lock() + threading.Thread.__init__(self) + self.init() #call init of inheriting class + # self.__setitem__ = self.argDict.__setitem__ + # self.__getitem__ = self.argDict.__getitem__ |