hal: Branch 'master'
Richard Hughes
hughsient at kemper.freedesktop.org
Wed Jan 3 16:44:15 PST 2007
doc/spec/example-manager.py | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
New commits:
diff-tree 774e953785f5d6148933471e203779445c914d15 (from 6de338648dc70439ea2c28ec36a7c05c5242c58e)
Author: Thomas Petazzoni <thomas.petazzoni at enix.org>
Date: Thu Jan 4 00:44:04 2007 +0000
fix python example to work with a recent dbus
The Python example provided in the documentation no longer works with recent
version of DBus. The get_service() method of the bus object no longer exists,
and has been replaced by get_object(). Moreover, the prototype of the callback
also changed.
diff --git a/doc/spec/example-manager.py b/doc/spec/example-manager.py
index 753bf8a..861dc1b 100755
--- a/doc/spec/example-manager.py
+++ b/doc/spec/example-manager.py
@@ -2,20 +2,18 @@
import gtk
import dbus
+import dbus.glib
-def device_added(interface, signal_name, service, path, message):
- [udi] = message.get_args_list ()
+def device_added(udi):
print 'Device %s was added'%udi
-def device_removed(interface, signal_name, service, path, message):
- [udi] = message.get_args_list ()
+def device_removed(udi):
print 'Device %s was removed'%udi
bus = dbus.Bus (dbus.Bus.TYPE_SYSTEM)
-hal_service = bus.get_service ('org.freedesktop.Hal')
-hal_manager = hal_service.get_object ('/org/freedesktop/Hal/Manager',
- 'org.freedesktop.Hal.Manager')
+hal_manager = bus.get_object ('org.freedesktop.Hal',
+ '/org/freedesktop/Hal/Manager')
devices = hal_manager.GetAllDevices ()
for d in devices:
More information about the hal-commit
mailing list