summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2007-03-27 01:22:35 -0400
committerDavid Zeuthen <davidz@redhat.com>2007-03-27 01:22:35 -0400
commit6c4e1b748beba80a564262c9b877803833b851aa (patch)
tree6d6b9b685332e82cdaae17f6cee978fc84398a5b /examples
parent56eff0f1824c26ef6d2580957b10889f17add691 (diff)
clean up locking example
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/interface-locking-test.py39
1 files changed, 3 insertions, 36 deletions
diff --git a/examples/interface-locking-test.py b/examples/interface-locking-test.py
index ff0c7ddc..a31a4be2 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",
"/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")