fix zeroconf.resolve_all()

This commit is contained in:
Stefan Bethge 2006-05-29 22:17:13 +00:00
parent 77e53f7488
commit 43e44b51dd
2 changed files with 9 additions and 7 deletions

View File

@ -20,6 +20,7 @@ class Roster:
return self._data[item] return self._data[item]
def getRaw(self): def getRaw(self):
print 'getRaw in Roster'
return self._data return self._data
def getResources(self, jid): def getResources(self, jid):
@ -27,10 +28,8 @@ class Roster:
# return self # return self
''' '''
getRaw()
delItem(jid) delItem(jid)
getItem(jid) getItem(jid)
getResources(jid)
getStatus(jid) getStatus(jid)
getPriority(jid) getPriority(jid)
getShow(jid) getShow(jid)

View File

@ -180,15 +180,18 @@ class Zeroconf:
def disconnect(self): def disconnect(self):
self.remove_announce() self.remove_announce()
# refresh data manually - really ok or too much traffic? # refresh data manually - really ok or too much traffic?
def resolve_all(self): def resolve_all(self):
for key in contacts.keys(): for val in self.contacts.values():
self.server.ResolveService( int(key.interface), int(key.protocol), key.name, \ #val:(name, stype, domain, interface, protocol, host, address, port, txt)
self.stype, key.domain, avahi.PROTO_UNSPEC, dbus.UInt32(0),\ self.server.ResolveService( int(val[3]), int(val[4]), val[0], \
self.stype, val[2], avahi.PROTO_UNSPEC, dbus.UInt32(0),\
reply_handler=self.service_resolved_callback, error_handler=self.print_error_callback) reply_handler=self.service_resolved_callback, error_handler=self.print_error_callback)
def get_contacts(self): def get_contacts(self):
self.resolve_all self.resolve_all()
return self.contacts return self.contacts