Don’t set the wait time to True instead of leaving its float default, in examples.
This commit is contained in:
parent
e1c944d723
commit
49beb3ac08
3 changed files with 3 additions and 7 deletions
|
@ -83,9 +83,7 @@ class ActionUserBot(slixmpp.ClientXMPP):
|
||||||
iq2['action']['method'] = 'bye'
|
iq2['action']['method'] = 'bye'
|
||||||
iq2.send(block=False)
|
iq2.send(block=False)
|
||||||
|
|
||||||
# The wait=True delays the disconnect until the queue
|
self.disconnect()
|
||||||
# of stanzas to be sent becomes empty.
|
|
||||||
self.disconnect(wait=True)
|
|
||||||
except XMPPError:
|
except XMPPError:
|
||||||
print('There was an error sending the custom action.')
|
print('There was an error sending the custom action.')
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class AvatarDownloader(slixmpp.ClientXMPP):
|
||||||
|
|
||||||
print('Waiting for presence updates...\n')
|
print('Waiting for presence updates...\n')
|
||||||
self.presences_received.wait(15)
|
self.presences_received.wait(15)
|
||||||
self.disconnect(wait=True)
|
self.disconnect()
|
||||||
|
|
||||||
def on_vcard_avatar(self, pres):
|
def on_vcard_avatar(self, pres):
|
||||||
print("Received vCard avatar update from %s" % pres['from'].bare)
|
print("Received vCard avatar update from %s" % pres['from'].bare)
|
||||||
|
|
|
@ -58,9 +58,7 @@ class SendMsgBot(slixmpp.ClientXMPP):
|
||||||
mbody=self.msg,
|
mbody=self.msg,
|
||||||
mtype='chat')
|
mtype='chat')
|
||||||
|
|
||||||
# Using wait=True ensures that the send queue will be
|
self.disconnect()
|
||||||
# emptied before ending the session.
|
|
||||||
self.disconnect(wait=True)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue