diff --git a/TODO v2.0 b/TODO v2.0 index 25783e8e..08ee3cf4 100644 --- a/TODO v2.0 +++ b/TODO v2.0 @@ -54,8 +54,11 @@ Driver: https://docs.python.org/3.2/library/pty.html - implement PTY Input driver - ATK input driver (don't grab on graphical interface) +https://git.linux-a11y.org/AIT/pyatspi2/src/master/examples/keypress.py - try to autodetect encoding (Easy for contribution) https://stackoverflow.com/questions/6396659/how-do-you-get-the-encoding-of-the-terminal-from-within-a-python-script +- Dectalk SpeechDriver +https://github.com/tvraman/emacspeak/blob/master/servers/obsolete/python/dectalk.py Settings: - configuration should be overwritable with parameter and alternative paths (Easy for contribution) diff --git a/src/fenrir/screenDriver/vcsaDriver.py b/src/fenrir/screenDriver/vcsaDriver.py index c667a0f1..b617e8cf 100644 --- a/src/fenrir/screenDriver/vcsaDriver.py +++ b/src/fenrir/screenDriver/vcsaDriver.py @@ -65,31 +65,35 @@ class driver(): self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) def getSessionInformation(self): - bus = dbus.SystemBus() - if not self.ListSessions: - obj = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1') - inf = dbus.Interface(obj, 'org.freedesktop.login1.Manager') - self.ListSessions = inf.get_dbus_method('ListSessions') - - sessions = self.ListSessions() - self.env['screen']['autoIgnoreScreens'] = [] - for session in sessions: - obj = bus.get_object('org.freedesktop.login1', session[4]) - inf = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') - sessionType = inf.Get('org.freedesktop.login1.Session', 'Type') - screen = str(inf.Get('org.freedesktop.login1.Session', 'VTNr')) - if screen == '': - screen = str(inf.Get('org.freedesktop.login1.Session', 'TTY')) - screen = screen[screen.upper().find('TTY') + 3:] - if screen == '': - self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR) - return - if sessionType.upper() == 'X11': - self.env['screen']['autoIgnoreScreens'].append(screen) - if screen == self.env['screen']['newTTY'] : - if self.env['general']['currUser'] != session[2]: - self.env['general']['prevUser'] = self.env['general']['currUser'] - self.env['general']['currUser'] = session[2] + try: + bus = dbus.SystemBus() + if not self.ListSessions: + obj = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1') + inf = dbus.Interface(obj, 'org.freedesktop.login1.Manager') + self.ListSessions = inf.get_dbus_method('ListSessions') + + sessions = self.ListSessions() + self.env['screenData']['autoIgnoreScreens'] = [] + for session in sessions: + obj = bus.get_object('org.freedesktop.login1', session[4]) + inf = dbus.Interface(obj, 'org.freedesktop.DBus.Properties') + sessionType = inf.Get('org.freedesktop.login1.Session', 'Type') + screen = str(inf.Get('org.freedesktop.login1.Session', 'VTNr')) + if screen == '': + screen = str(inf.Get('org.freedesktop.login1.Session', 'TTY')) + screen = screen[screen.upper().find('TTY') + 3:] + if screen == '': + self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR) + return + if sessionType.upper() == 'X11': + self.env['screenData']['autoIgnoreScreens'].append(screen) + if screen == self.env['screenData']['newTTY'] : + if self.env['generalInformation']['currUser'] != session[2]: + self.env['generalInformation']['prevUser'] = self.env['generalInformation']['currUser'] + self.env['generalInformation']['currUser'] = session[2] + except Exception as e: + self.env['runtime']['debug'].writeDebugOut('getSessionInformation: Maybe no LoginD:' + str(e),debug.debugLevel.ERROR) + self.env['screenData']['autoIgnoreScreens'] = [] def update(self, trigger='onUpdate'): newContentBytes = b''