catch some driver calls

This commit is contained in:
chrys 2018-05-11 23:34:13 +02:00
parent e812d4e2ae
commit 426fecf60f
2 changed files with 14 additions and 9 deletions

View File

@ -158,6 +158,7 @@ class screenManager():
return '' return ''
if attributeFormatString == '': if attributeFormatString == '':
return '' return ''
try:
attributeFormatString = attributeFormatString.replace('fenrirBGColor', self.env['runtime']['screenDriver'].getFenrirBGColor(attribute)) attributeFormatString = attributeFormatString.replace('fenrirBGColor', self.env['runtime']['screenDriver'].getFenrirBGColor(attribute))
attributeFormatString = attributeFormatString.replace('fenrirFGColor', self.env['runtime']['screenDriver'].getFenrirFGColor(attribute)) attributeFormatString = attributeFormatString.replace('fenrirFGColor', self.env['runtime']['screenDriver'].getFenrirFGColor(attribute))
attributeFormatString = attributeFormatString.replace('fenrirUnderline', self.env['runtime']['screenDriver'].getFenrirUnderline(attribute)) attributeFormatString = attributeFormatString.replace('fenrirUnderline', self.env['runtime']['screenDriver'].getFenrirUnderline(attribute))
@ -165,6 +166,8 @@ class screenManager():
attributeFormatString = attributeFormatString.replace('fenrirBlink', self.env['runtime']['screenDriver'].getFenrirBlink(attribute)) attributeFormatString = attributeFormatString.replace('fenrirBlink', self.env['runtime']['screenDriver'].getFenrirBlink(attribute))
attributeFormatString = attributeFormatString.replace('fenrirFontSize', self.env['runtime']['screenDriver'].getFenrirFontSize(attribute)) attributeFormatString = attributeFormatString.replace('fenrirFontSize', self.env['runtime']['screenDriver'].getFenrirFontSize(attribute))
attributeFormatString = attributeFormatString.replace('fenrirFont', self.env['runtime']['screenDriver'].getFenrirFont(attribute)) attributeFormatString = attributeFormatString.replace('fenrirFont', self.env['runtime']['screenDriver'].getFenrirFont(attribute))
except Exception as e:
pass
return attributeFormatString return attributeFormatString
def isSuspendingScreen(self, screen = None): def isSuspendingScreen(self, screen = None):
if screen == None: if screen == None:
@ -212,7 +215,6 @@ class screenManager():
try: try:
self.env['runtime']['screenDriver'].injectTextToScreen(text, screen) self.env['runtime']['screenDriver'].injectTextToScreen(text, screen)
except Exception as e: except Exception as e:
print(e)
self.env['runtime']['debug'].writeDebugOut('screenManager:injectTextToScreen ' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('screenManager:injectTextToScreen ' + str(e),debug.debugLevel.ERROR)
def changeBrailleScreen(self): def changeBrailleScreen(self):

View File

@ -153,7 +153,10 @@ class settingsManager():
def shutdownDriver(self, driverType): def shutdownDriver(self, driverType):
if self.env['runtime'][driverType] == None: if self.env['runtime'][driverType] == None:
return return
try:
self.env['runtime'][driverType].shutdown() self.env['runtime'][driverType].shutdown()
except Exception as e:
pass
del self.env['runtime'][driverType] del self.env['runtime'][driverType]
def setFenrirKeys(self, keys): def setFenrirKeys(self, keys):