From 3212d1da26161c036e811be9af0ea3186ae3b49f Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 8 Oct 2016 14:58:48 +0200 Subject: [PATCH] fix brlapi typo --- src/fenrir/brailleDriver/brlapi.py | 6 ++++-- src/fenrir/core/screenManager.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/fenrir/brailleDriver/brlapi.py b/src/fenrir/brailleDriver/brlapi.py index 387b88cf..22d88368 100644 --- a/src/fenrir/brailleDriver/brlapi.py +++ b/src/fenrir/brailleDriver/brlapi.py @@ -16,12 +16,14 @@ class driver(): try: import brlapi except Exception as e: + print(e) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) return try: - self.connectDevice() + self._brl = brlapi.Connection() except Exception as e: + print(e) self.env['runtime']['debug'].writeDebugOut('BRAILLE.connectDevice '+str(e),debug.debugLevel.ERROR) return self._isInitialized = True @@ -48,7 +50,7 @@ class driver(): def enterScreen(self, screen): if not self._isInitialized: return - self._brl.enterTtyMode(screen) + self._brl.enterTtyMode(int(screen)) def leveScreen(self): if not self._isInitialized: diff --git a/src/fenrir/core/screenManager.py b/src/fenrir/core/screenManager.py index 7ee7cc76..de422355 100644 --- a/src/fenrir/core/screenManager.py +++ b/src/fenrir/core/screenManager.py @@ -58,6 +58,12 @@ class screenManager(): if not self.env['runtime']['brailleDriver']: return if not self.isSuspendingScreen(self.env['screenData']['oldTTY']): - self.env['runtime']['brailleDriver'].leveScreen() + try: + self.env['runtime']['brailleDriver'].leveScreen() + except Exception as e: + print(e) if not self.isSuspendingScreen(): - self.env['runtime']['brailleDriver'].enterScreen(self.env['screenData']['newTTY']) + try: + self.env['runtime']['brailleDriver'].enterScreen(self.env['screenData']['newTTY']) + except Exception as e: + print(e)