diff --git a/src/fenrir/core/inputDriver.py b/src/fenrir/core/inputDriver.py index d1c60e79..39593d26 100644 --- a/src/fenrir/core/inputDriver.py +++ b/src/fenrir/core/inputDriver.py @@ -9,51 +9,39 @@ from core import debug class inputDriver(): def __init__(self): self._initialized = False - def initialize(self, environment): self.env = environment - self._isInitialized = True + self._isInitialized = True def shutdown(self): - pass - + self._isInitialized = False def getInputEvent(self): time.sleep(0.05) if not self._initialized: return None - def writeEventBuffer(self): if not self._initialized: return - def clearEventBuffer(self): if not self._initialized: return del self.env['input']['eventBuffer'][:] - def updateInputDevices(self, force = False, init = False): if not self._initialized: return - def getLedState(self, led = 0): if not self._initialized: return False - return False - + return False def toggleLedState(self, led = 0): if not self._initialized: - return None - + return None def grabDevices(self): if not self._initialized: - return None - + return None def releaseDevices(self): if not self._initialized: - return None - + return None def __del__(self): if not self._initialized: return None self.releaseDevices() - - diff --git a/src/fenrir/inputDriver/evdevDriver.py b/src/fenrir/inputDriver/evdevDriver.py index 72596042..2a5e81f5 100644 --- a/src/fenrir/inputDriver/evdevDriver.py +++ b/src/fenrir/inputDriver/evdevDriver.py @@ -30,16 +30,16 @@ from ctypes import c_bool from core.eventData import fenrirEventType from core import inputData from core import debug +from core.inputDriver import inputDriver - -class driver(): +class driver(inputDriver): def __init__(self): + inputDriver.__init__(self) self._manager = multiprocessing.Manager() self.iDevices = {} self.iDevicesFD = self._manager.list() self.uDevices = {} self.iDeviceNo = 0 - self._initialized = False self.watchDog = Value(c_bool, True) def initialize(self, environment): self.env = environment @@ -70,9 +70,6 @@ class driver(): def plugInputDeviceWatchdogTimer(self, active): time.sleep(2.5) return time.time() - def shutdown(self): - if not self._initialized: - return def inputWatchdog(self,active , params): try: deviceFd = [] @@ -323,10 +320,6 @@ class driver(): self.removeDevice(fd) self.iDevices.clear() self.uDevices.clear() - self.iDeviceNo = 0 - - def __del__(self): - if not self._initialized: - return + self.iDeviceNo = 0