Looking for some Python dbus/hal help

David Zeuthen david at fubar.dk
Thu Mar 17 11:39:16 PST 2005


Hi,

> Resent-From: Jesse Keating <jkeating at j2solutions.net>
> Resent-To: hal at lists.freedesktop.org

(it's not considered good form to just bounce a message onto other
mailing lists; the To: and Reply-To: fields are obviously wrong; I had
to modify them)

On Thu, 2005-03-17 at 11:04 -0800, Jesse Keating wrote:
> I need to plug into hal through dbus in python a bit.  So I'm looking
> for some good documentation that covers dbus and hal, specifically ways
> to find hal entries for kernels and devices and such.
> 
> I've 'borrowed' some code from system-config-packages, namely:
> 
>     # get the devices from HAL
>     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')
>     volume = hal_manager.FindDeviceStringMatch('volume.label', label)[0]
> # Look for our disk label, return first one
>     props = hal_service.get_object(volume,
> "org.freedesktop.Hal.Device").GetAllProperties() # Get all the
> properties of the volume
> 
>     mount = props['volume.mount_point'] # Get the mount point and return
> it...
> 
> But I'm looking for alternatives to the 'FindDeviceStringMatch' and it's
> friends.  Can anybody help out as I pour through the sources to these
> modules?

Why do you need an alternative? What do want to achieve that the code
snippet doesn't do?

And you don't need to search the source; there's an extensive document
here and an article here that may be of help

 http://cvs.freedesktop.org/*checkout*/hal/hal/doc/spec/hal-spec.html?only_with_tag=hal-0_4-stable-branch#dbus-api
 http://www.redhat.com/magazine/003jan05/features/hal/

Good luck,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list