diff options
Diffstat (limited to 'operationscore')
-rw-r--r-- | operationscore/Input.py | 8 | ||||
-rw-r--r-- | operationscore/SmootCoreObject.py | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/operationscore/Input.py b/operationscore/Input.py index 6b56cd5..3dd74cf 100644 --- a/operationscore/Input.py +++ b/operationscore/Input.py @@ -1,5 +1,5 @@ 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 @@ -34,7 +34,11 @@ class Input(ThreadedSmootCoreObject): except: return False def run(self): - while self.parentAlive(): + while 1: + try: + die = self.parentAlive() + except: + break time.sleep(self.argDict['RefreshInterval']/float(1000)) self.acquireLock() self.sensingLoop() diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py index 7e3c8bd..291519a 100644 --- a/operationscore/SmootCoreObject.py +++ b/operationscore/SmootCoreObject.py @@ -18,7 +18,7 @@ class SmootCoreObject(object): def releaseLock(self): self.lock.release() def className(self): - return str(self.__class__).split('.')[-1] #TODO: this doesn't work. + return self.__class__.__name__ def __setitem__(self,k, item): self.argDict[k] = item def __getitem__(self, item): |