On Tue, 2010-04-13 at 23:19 +0200, ext Thomas Waelti wrote:
> (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?

You mean hildon-home (hildon-desktop does not have plugins). I found
some code from
http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#connecting-to-the-bus

=====
import dbus
from dbus.mainloop.glib import DBusGMainLoop

dbus_loop = DBusGMainLoop()

bus = dbus.SessionBus(mainloop=dbus_loop)
=====

Just replace SessionBus with SystemBus, yes?

-Kimmo

> 
> 
> Thanks all
> -Tom
> 
> 
> > 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-develop...@garage.maemo.org
> > https://garage.maemo.org/mailman/listinfo/pymaemo-developers
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers

_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to