Changeset 203:7f8f69adf13b


Ignore:
Timestamp:
Oct 3, 2016, 8:49:10 AM (4 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
rebase_source:
a651e00ec42e4970683d971de34fb89406b9ff66
Message:

imported patch py3-xmppim.patch

Location:
wokkel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_xmppim.py

    r179 r203  
    66"""
    77
     8from __future__ import division, absolute_import
     9
    810from twisted.internet import defer
    911from twisted.trial import unittest
     12from twisted.python.compat import unicode
    1013from twisted.words.protocols.jabber import error
    1114from twisted.words.protocols.jabber.jid import JID
     
    897900        element = request.toElement()
    898901        children = element.elements()
    899         child = children.next()
     902        child = next(children)
    900903        self.assertEqual(NS_ROSTER, child.uri)
    901904        self.assertEqual('query', child.name)
     
    910913        element = request.toElement()
    911914        children = element.query.elements()
    912         child = children.next()
     915        child = next(children)
    913916        self.assertEqual(NS_ROSTER, child.uri)
    914917        self.assertEqual('item', child.name)
  • wokkel/xmppim.py

    r179 r203  
    1111"""
    1212
     13from __future__ import division, absolute_import
     14
    1315import warnings
    1416
    1517from twisted.internet import defer
     18from twisted.python.compat import iteritems, itervalues, unicode
    1619from twisted.words.protocols.jabber import error
    1720from twisted.words.protocols.jabber.jid import JID
     
    4649
    4750        if statuses is not None:
    48             for lang, status in statuses.iteritems():
     51            for lang, status in iteritems(statuses):
    4952                s = self.addElement('status', content=status)
    5053                if lang:
     
    5962
    6063        if statuses is not None:
    61             for lang, status in statuses.iteritems():
     64            for lang, status in iteritems(statuses):
    6265                s = self.addElement('status', content=status)
    6366                if lang:
     
    307310            return self.statuses[None]
    308311        elif self.statuses:
    309             for status in self.status.itervalues():
     312            for status in itervalues(self.status):
    310313                return status
    311314        else:
     
    353356                presence.addElement('priority', content=unicode(self.priority))
    354357
    355         for lang, text in self.statuses.iteritems():
     358        for lang, text in iteritems(self.statuses):
    356359            status = presence.addElement('status', content=text)
    357360            if lang:
Note: See TracChangeset for help on using the changeset viewer.