[maemo-developers] [pymaemo] hildon-desktop: getting D-Bus?

From: Thomas Waelti twaelti at gmail.com
Date: Wed Apr 14 00:19:20 EEST 2010
(Crossposting to maemo-devel, hoping for a Hildon-Desktop or D-Bus expert to pick this up. Original thread is at https://garage.maemo.org/pipermail/pymaemo-developers/2010-April/001444.html )

Thanks for a very interesting input. Unfortunately, it didn't work for my needs, as I must get my hands on the SYSTEM bus, not the Session one.
I tried your example, changing it to

    self.bus = dbus.bus.BusConnection("unix:abstract=/var/run/dbus/system_bus_socket")

However, I get this error:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused

Isn't this the correct address of the system dbus?
Or do I have a permission (or other) problem when trying to get on the system-dbus from hildon-desktop?

Thanks all

> As a follow-up to the discussion about d-bus from a hildon widget a
> few days ago that I found out while having the same problem, I've
> finally managed to get something that seems to be working for me:
> # Create a session bus.
> import dbus
> from dbus.mainloop.glib import DBusGMainLoop
> dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
> from os import environ
> bus = dbus.bus.BusConnection(environ["DBUS_SESSION_BUS_ADDRESS"])
> And then bus can be used as usual. I haven't done a whole lot of
> testing, as I just found this out, but it appears to be working both
> in command line mode and as a home widget.
>  Yves.
> _______________________________________________
> pymaemo-developers mailing list
> pymaemo-developers at garage.maemo.org
> https://garage.maemo.org/mailman/listinfo/pymaemo-developers
More information about the maemo-developers mailing list