dont fill ignore screen list if loginD is not available
This commit is contained in:
parent
7f1b00c741
commit
497f9eaa5c
@ -65,32 +65,35 @@ class driver():
|
|||||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
def getSessionInformation(self):
|
def getSessionInformation(self):
|
||||||
bus = dbus.SystemBus()
|
try:
|
||||||
if not self.ListSessions:
|
bus = dbus.SystemBus()
|
||||||
obj = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1')
|
if not self.ListSessions:
|
||||||
inf = dbus.Interface(obj, 'org.freedesktop.login1.Manager')
|
obj = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1')
|
||||||
self.ListSessions = inf.get_dbus_method('ListSessions')
|
inf = dbus.Interface(obj, 'org.freedesktop.login1.Manager')
|
||||||
|
self.ListSessions = inf.get_dbus_method('ListSessions')
|
||||||
sessions = self.ListSessions()
|
|
||||||
self.env['screenData']['autoIgnoreScreens'] = []
|
sessions = self.ListSessions()
|
||||||
for session in sessions:
|
self.env['screenData']['autoIgnoreScreens'] = []
|
||||||
obj = bus.get_object('org.freedesktop.login1', session[4])
|
for session in sessions:
|
||||||
inf = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
|
obj = bus.get_object('org.freedesktop.login1', session[4])
|
||||||
sessionType = inf.Get('org.freedesktop.login1.Session', 'Type')
|
inf = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
|
||||||
screen = str(inf.Get('org.freedesktop.login1.Session', 'VTNr'))
|
sessionType = inf.Get('org.freedesktop.login1.Session', 'Type')
|
||||||
if screen == '':
|
screen = str(inf.Get('org.freedesktop.login1.Session', 'VTNr'))
|
||||||
screen = str(inf.Get('org.freedesktop.login1.Session', 'TTY'))
|
if screen == '':
|
||||||
screen = screen[screen.upper().find('TTY') + 3:]
|
screen = str(inf.Get('org.freedesktop.login1.Session', 'TTY'))
|
||||||
if screen == '':
|
screen = screen[screen.upper().find('TTY') + 3:]
|
||||||
self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR)
|
if screen == '':
|
||||||
return
|
self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR)
|
||||||
if sessionType.upper() == 'X11':
|
return
|
||||||
self.env['screenData']['autoIgnoreScreens'].append(screen)
|
if sessionType.upper() == 'X11':
|
||||||
if screen == self.env['screenData']['newTTY'] :
|
self.env['screenData']['autoIgnoreScreens'].append(screen)
|
||||||
if self.env['generalInformation']['currUser'] != session[2]:
|
if screen == self.env['screenData']['newTTY'] :
|
||||||
self.env['generalInformation']['prevUser'] = self.env['generalInformation']['currUser']
|
if self.env['generalInformation']['currUser'] != session[2]:
|
||||||
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'):
|
def update(self, trigger='onUpdate'):
|
||||||
newContentBytes = b''
|
newContentBytes = b''
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user