<div dir="ltr"><div class="syntax"><div class="text" style="font-family: monospace;"><ol><li class="li1"><div class="de1"> bus = dbus.SystemBus<span class="br0">(</span><span class="br0">)</span></div></li><li class="li2">
<div class="de2"> </div></li><li class="li1"><div class="de1"> server = dbus.Interface<span class="br0">(</span> bus.get_object<span class="br0">(</span>avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER<span class="br0">)</span>, avahi.DBUS_INTERFACE_SERVER<span class="br0">)</span></div>
</li><li class="li2"><div class="de2"> </div></li><li class="li1"><div class="de1"> sbrowser = dbus.Interface<span class="br0">(</span>bus.get_object<span class="br0">(</span>avahi.DBUS_NAME,</div></li><li class="li2">
<div class="de2"> server.ServiceBrowserNew<span class="br0">(</span>avahi.IF_UNSPEC,</div></li><li class="li1"><div class="de1"> avahi.PROTO_UNSPEC, '_ipp._tcp', 'local', dbus.UInt32<span class="br0">(</span><span class="nu0">0</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span>,</div>
</li><li class="li2"><div class="de2"> avahi.DBUS_INTERFACE_SERVICE_BROWSER<span class="br0">)</span></div></li><li class="li1"><div class="de1"> </div></li><li class="li2"><div class="de2"> sbrowser.connect_to_signal<span class="br0">(</span>"ItemNew", self._printer_added_cb<span class="br0">)</span> </div>
</li></ol></div></div>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.<br>
<br>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.<br><br>Thanks in advance for any help.<br><br>--<br>Justin Gallardo<br>
</div>