From a636d8020e7edc6bf0f5a174d1495a249671a1fa Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 28 Mar 2018 17:09:56 +0200 Subject: [PATCH] fallback to dummy if possible --- src/fenrirscreenreader/core/settingsManager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/fenrirscreenreader/core/settingsManager.py b/src/fenrirscreenreader/core/settingsManager.py index 446046e5..abc2f4ef 100644 --- a/src/fenrirscreenreader/core/settingsManager.py +++ b/src/fenrirscreenreader/core/settingsManager.py @@ -141,11 +141,15 @@ class settingsManager(): self.env['runtime'][driverType].initialize(self.env) self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") OK",debug.debugLevel.INFO, onAnyLevel=True) except Exception as e: - driver_mod = module_utils.importModule(driverName, - fenrirPath + "/" + driverType + '/dummyDriver.py') - self.env['runtime'][driverType] = driver_mod.driver() - self.env['runtime'][driverType].initialize(self.env) - self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") FAILED:"+ str(e), debug.debugLevel.ERROR) + self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") FAILED:"+ str(e), debug.debugLevel.ERROR) + try: + driver_mod = module_utils.importModule(driverName, + fenrirPath + "/" + driverType + '/dummyDriver.py') + self.env['runtime'][driverType] = driver_mod.driver() + self.env['runtime'][driverType].initialize(self.env) + except Exception as e: + self.env['runtime']['debug'].writeDebugOut('(fallback) Loading Driver ' + driverType + ' (dummyDriver) FAILED:'+ str(e), debug.debugLevel.ERROR) + def shutdownDriver(self, driverType): if self.env['runtime'][driverType] == None: return