[sugar] Problems with DBus and Avahi
Tomeu Vizoso
tomeu at tomeuvizoso.net
Sat Sep 27 04:07:43 EDT 2008
On Sat, Sep 27, 2008 at 12:10 AM, Justin Gallardo
<justin.gallardo at gmail.com> wrote:
> bus = dbus.SystemBus()
>
> server = dbus.Interface( bus.get_object(avahi.DBUS_NAME,
> avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
>
> sbrowser = dbus.Interface(bus.get_object(avahi.DBUS_NAME,
> server.ServiceBrowserNew(avahi.IF_UNSPEC,
> avahi.PROTO_UNSPEC, '_ipp._tcp', 'local',
> dbus.UInt32(0))),
> avahi.DBUS_INTERFACE_SERVICE_BROWSER)
>
> sbrowser.connect_to_signal("ItemNew", self._printer_added_cb)
>
> I am trying to insert this code into model/MeshModel.py:__init__() in order
> create my newly written PrinterModel. It would appear that ItemNew events
> aren't being emitted, as the self._printer_added_cb call-back is never
> invoked. I've tested this code in an external python script with
> sugar-shell, and it is working perfectly.
>
> I am sure that I am missing something silly that is specfic to the sugar
> environment, so I am curious if anyone has any ideas as to why it isn't
> working.
>
> Thanks in advance for any help.
Maybe something related to rainbow? Check the dbus policy in /etc.
HTH,
Tomeu
More information about the Sugar
mailing list