mutating this, still doens't work, starting to believe there's a change in bus object...
authorChris Koeritz <fred@gruntose.com>
Thu, 5 Jul 2012 12:55:34 +0000 (08:55 -0400)
committerChris Koeritz <fred@gruntose.com>
Thu, 5 Jul 2012 12:55:34 +0000 (08:55 -0400)
possibly switching up to gdbus.

database/configuration/xscreensaver/screenlock_dbus.py

index 14785f1e41c275763f38de5d8a6c8fa917048ed1..5ec4cadf14c49c52d237c0d50c9839c2d21b803e 100644 (file)
@@ -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()