From: Chris Koeritz Date: Thu, 5 Jul 2012 12:55:34 +0000 (-0400) Subject: mutating this, still doens't work, starting to believe there's a change in bus object... X-Git-Tag: 2.140.90~1294 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=dc218f31310e5fa1bec2091c1cd29f6772c40336;p=feisty_meow.git mutating this, still doens't work, starting to believe there's a change in bus object i need, possibly switching up to gdbus. --- diff --git a/database/configuration/xscreensaver/screenlock_dbus.py b/database/configuration/xscreensaver/screenlock_dbus.py index 14785f1e..5ec4cadf 100644 --- a/database/configuration/xscreensaver/screenlock_dbus.py +++ b/database/configuration/xscreensaver/screenlock_dbus.py @@ -5,24 +5,49 @@ import dbus.service import dbus.glib import gobject import os +import sys class ScreenDbusObj(dbus.service.Object): def __init__(self): # stuff the logging into a temporary and hidden directory. try: - os.chdir(os.environ['HOME'] + "/.zz_temp_screenlock_menu"); + os.chdir(os.environ['HOME'] + "/.zz_temp_screenlock_menu") + print (os.environ['HOME'] + "/.zz_temp_screenlock_menu" + " was already there") + sys.stdout.flush() except: - os.mkdir(os.environ['HOME'] + "/.zz_temp_screenlock_menu"); - os.chdir(os.environ['HOME'] + "/.zz_temp_screenlock_menu"); + print (os.environ['HOME'] + "/.zz_temp_screenlock_menu" + " is not there yet") + sys.stdout.flush() + os.mkdir(os.environ['HOME'] + "/.zz_temp_screenlock_menu") + os.chdir(os.environ['HOME'] + "/.zz_temp_screenlock_menu") + print (os.environ['HOME'] + "/.zz_temp_screenlock_menu" + " is there now") + sys.stdout.flush() + print ("about to create a dbus") + sys.stdout.flush() session_bus = dbus.SessionBus() + print ("about to setup a bus name") + sys.stdout.flush() bus_name=dbus.service.BusName("org.gnome.ScreenSaver",bus=session_bus) + print ("about to init dbus service") + sys.stdout.flush() dbus.service.Object.__init__(self,bus_name, '/org/gnome/ScreenSaver') + print ("after init dbus service") + sys.stdout.flush() @dbus.service.method("org.gnome.ScreenSaver") def Lock(self): + print ("saw the command to lock the screen, about to lock") + sys.stdout.flush() os.system( "xscreensaver-command -lock" ) + print ("issued xscreensaver request to lock the screen") + sys.stdout.flush() if __name__ == '__main__': + print ("into main of screeny") + sys.stdout.flush() object=ScreenDbusObj() + print ("after creating the screen dbus object, about to go into loop") + sys.stdout.flush() gobject.MainLoop().run() + print ("after loop, exiting from app") + sys.stdout.flush()