hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Mar 26 22:22:34 PDT 2007


 examples/interface-locking-test.py |   39 ++-----------------------------------
 1 files changed, 3 insertions(+), 36 deletions(-)

New commits:
diff-tree 6c4e1b748beba80a564262c9b877803833b851aa (from 56eff0f1824c26ef6d2580957b10889f17add691)
Author: David Zeuthen <davidz at redhat.com>
Date:   Tue Mar 27 01:22:35 2007 -0400

    clean up locking example

diff --git a/examples/interface-locking-test.py b/examples/interface-locking-test.py
index ff0c7dd..a31a4be 100755
--- a/examples/interface-locking-test.py
+++ b/examples/interface-locking-test.py
@@ -2,11 +2,9 @@
 
 
 import dbus
-import sys
 import time
-import os
 
-# this is just various test code
+# this example show how to prevent automounters from mounting volumes
 
 bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)
 
@@ -14,38 +12,7 @@ manager = dbus.Interface(bus.get_object(
                                          "/org/freedesktop/Hal/Manager"),
                           "org.freedesktop.Hal.Manager")
 
-computer = dbus.Interface(bus.get_object("org.freedesktop.Hal",
-                                         "/org/freedesktop/Hal/devices/computer"),
-                          "org.freedesktop.Hal.Device")
-
-#                                       "/org/freedesktop/Hal/devices/volume_uuid_456C_AAA8"),
-
-device = dbus.Interface(bus.get_object("org.freedesktop.Hal",
-                                       "/org/freedesktop/Hal/devices/macbook_pro_keyboard_backlight"),
-                        "org.freedesktop.Hal.Device")
-device2 = dbus.Interface(bus.get_object("org.freedesktop.Hal",
-                                        "/org/freedesktop/Hal/devices/macbook_pro_keyboard_backlight"),
-                         "org.freedesktop.Hal.Device.KeyboardBacklight")
-
-device3 = dbus.Interface(bus.get_object("org.freedesktop.Hal",
-                                       "/org/freedesktop/Hal/devices/storage_serial_Kingston_DataTraveler_2_0_07F0E4611101494D"),
-                        "org.freedesktop.Hal.Device")
-
 manager.AcquireGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage", True)
-time.sleep(10000)
-
-#device3.AcquireInterfaceLock("org.freedesktop.Hal.Device.Storage", True)
-#time.sleep(100000)
-
-#manager.AcquireGlobalInterfaceLock("org.freedesktop.Hal.Device.KeyboardBacklight")
-#device.AcquireInterfaceLock("org.freedesktop.Hal.Device.KeyboardBacklight")
-#n = 0
-#while True:
-#    time.sleep(1)
-#    device2.SetBrightness (n)
-#    n = n + 10
-#    if (n > 200):
-#        n = 0
-#manager.ReleaseGlobalInterfaceLock("org.freedesktop.Hal.Device.KeyboardBacklight")
-#device.ReleaseInterfaceLock("org.freedesktop.Hal.Device.KeyboardBacklight")
+time.sleep(10)
+manager.ReleaseGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage")
 


More information about the hal-commit mailing list