[sugar] Problems with DBus and Avahi

Justin Gallardo justin.gallardo
Fri Sep 26 18:10:05 EDT 2008


   1.         bus = dbus.SystemBus()
   2.
   3.         server = dbus.Interface( bus.get_object(avahi.DBUS_NAME,
   avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
   4.
   5.         sbrowser = dbus.Interface(bus.get_object(avahi.DBUS_NAME,
   6.                 server.ServiceBrowserNew(avahi.IF_UNSPEC,
   7.                     avahi.PROTO_UNSPEC, '_ipp._tcp', 'local',
   dbus.UInt32(0))),
   8.                 avahi.DBUS_INTERFACE_SERVICE_BROWSER)
   9.
   10.         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.

--
Justin Gallardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20080926/b9a3cc78/attachment.htm 



More information about the Sugar-devel mailing list