fix zeroconf.resolve_all()
This commit is contained in:
parent
77e53f7488
commit
43e44b51dd
|
@ -20,6 +20,7 @@ class Roster:
|
|||
return self._data[item]
|
||||
|
||||
def getRaw(self):
|
||||
print 'getRaw in Roster'
|
||||
return self._data
|
||||
|
||||
def getResources(self, jid):
|
||||
|
@ -27,10 +28,8 @@ class Roster:
|
|||
# return self
|
||||
|
||||
'''
|
||||
getRaw()
|
||||
delItem(jid)
|
||||
getItem(jid)
|
||||
getResources(jid)
|
||||
getStatus(jid)
|
||||
getPriority(jid)
|
||||
getShow(jid)
|
||||
|
|
|
@ -180,15 +180,18 @@ class Zeroconf:
|
|||
def disconnect(self):
|
||||
self.remove_announce()
|
||||
|
||||
|
||||
|
||||
# refresh data manually - really ok or too much traffic?
|
||||
def resolve_all(self):
|
||||
for key in contacts.keys():
|
||||
self.server.ResolveService( int(key.interface), int(key.protocol), key.name, \
|
||||
self.stype, key.domain, avahi.PROTO_UNSPEC, dbus.UInt32(0),\
|
||||
for val in self.contacts.values():
|
||||
#val:(name, stype, domain, interface, protocol, host, address, port, txt)
|
||||
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)
|
||||
|
||||
def get_contacts(self):
|
||||
self.resolve_all
|
||||
self.resolve_all()
|
||||
return self.contacts
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue