summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/mandatory-locking-test.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/mandatory-locking-test.py b/examples/mandatory-locking-test.py
new file mode 100755
index 00000000..d863814f
--- /dev/null
+++ b/examples/mandatory-locking-test.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+
+import dbus
+import sys
+import time
+import os
+
+bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)
+device = dbus.Interface(bus.get_object("org.freedesktop.Hal",
+ "/org/freedesktop/Hal/devices/computer"),
+# "/org/freedesktop/Hal/devices/volume_label_EOS_DIGITAL"),
+ "org.freedesktop.Hal.Device")
+
+device.AcquireMandatoryLock("foo")
+device.AcquireMandatoryLock("foo2")
+time.sleep(2)
+device.ReleaseMandatoryLock("foo2")
+#device.ReleaseMandatoryLock("foo")
+time.sleep(2)