From 528f39768c321ca959e723858e598a3ee71a3920 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 30 Jan 2019 09:33:23 +0100 Subject: [PATCH] Update evdevDriver.py --- .../inputDriver/evdevDriver.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index a68a60a5..6d0084d7 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -48,19 +48,19 @@ class driver(inputDriver): self.env['runtime']['inputManager'].setShortcutType('KEY') global _evdevAvailable global _udevAvailable - self._initialized = _evdevAvailable and _udevAvailable - if not self._initialized: - global _evdevAvailableError - global _udevAvailableError - if not _udevAvailable: - self.env['runtime']['debug'].writeDebugOut('InputDriver:' + _udevAvailableError, debug.debugLevel.ERROR) - if not _evdevAvailable: - self.env['runtime']['debug'].writeDebugOut('InputDriver:' + _evdevAvailableError, debug.debugLevel.ERROR) - return + global _evdevAvailableError + global _udevAvailableError + if not _udevAvailable: + self.env['runtime']['debug'].writeDebugOut('InputDriver:' + _udevAvailableError, debug.debugLevel.ERROR) + if not _evdevAvailable: + self.env['runtime']['debug'].writeDebugOut('InputDriver:' + _evdevAvailableError, debug.debugLevel.ERROR) + return if _udevAvailable: self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog) + self._initialized = True + def plugInputDeviceWatchdogUdev(self,active , eventQueue): context = pyudev.Context() monitor = pyudev.Monitor.from_netlink(context)