Changeset 57:0d8b6cf41728 in ralphm-patches


Ignore:
Timestamp:
Mar 28, 2012, 1:43:02 PM (8 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Wokkel 0.7.0 release, clean up various patches.

Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • c2s_server_factory.patch

    r54 r57  
    11# HG changeset patch
    2 # Parent 52b9931fa5f5c6aeee617a4dad3e09d041ae4361
     2# Parent d76497171af8f3acf1efd2c8433fbdc3c4a55f92
    33Add factory for accepting client connections.
    44
     
    2121 * Add tests.
    2222
    23 diff -r 52b9931fa5f5 wokkel/client.py
    24 --- a/wokkel/client.py  Wed Oct 05 09:50:55 2011 +0200
    25 +++ b/wokkel/client.py  Wed Oct 05 09:58:11 2011 +0200
    26 @@ -16,9 +16,11 @@
    27  from twisted.internet import reactor
    28  from twisted.names.srvconnect import SRVConnector
    29  from twisted.words.protocols.jabber import client, error, sasl, xmlstream
    30 +from twisted.words.xish import domish, utility
     23diff -r d76497171af8 wokkel/client.py
     24--- a/wokkel/client.py  Wed Nov 30 09:31:07 2011 +0100
     25+++ b/wokkel/client.py  Wed Nov 30 09:32:01 2011 +0100
     26@@ -20,6 +20,7 @@
     27 from twisted.words.xish import domish
    3128 
    3229 from wokkel import generic
     30+from wokkel.compat import XmlStreamServerFactory
    3331 from wokkel.subprotocols import StreamManager
    34 +from wokkel.compat import XmlStreamServerFactory
    3532 
    3633 NS_CLIENT = 'jabber:client'
    37  
    38 @@ -345,3 +347,98 @@
     34@@ -347,3 +348,98 @@
    3935 
    4036 
  • c2s_stanza_handlers.patch

    r54 r57  
    11# HG changeset patch
    2 # Parent 9e8497278e0e4f8a145f321a4e4d22e3bb499b38
     2# Parent 24c6e79ab1c449f41fd5d4c2cb843dc16efe2c59
    33Add c2s protocol handlers for iq, message and presence stanzas.
    44
     
    88 * Save last unavailable presence for future probes.
    99
    10 diff -r 9e8497278e0e doc/examples/client_service.tac
     10diff -r 24c6e79ab1c4 doc/examples/client_service.tac
    1111--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
    12 +++ b/doc/examples/client_service.tac   Thu Oct 06 18:55:13 2011 +0200
     12+++ b/doc/examples/client_service.tac   Wed Mar 28 13:23:36 2012 +0200
    1313@@ -0,0 +1,75 @@
    1414+from twisted.application import service, strports
     
    8787+
    8888+sessionManager.connectionManager = c2sFactory
    89 diff -r 9e8497278e0e wokkel/im.py
    90 --- a/wokkel/im.py      Thu Oct 06 18:47:41 2011 +0200
    91 +++ b/wokkel/im.py      Thu Oct 06 18:55:13 2011 +0200
     89diff -r 24c6e79ab1c4 wokkel/im.py
     90--- a/wokkel/im.py      Wed Mar 28 13:22:34 2012 +0200
     91+++ b/wokkel/im.py      Wed Mar 28 13:23:36 2012 +0200
    9292@@ -10,7 +10,10 @@
    9393 U{RFC 6121<http://www.xmpp.org/rfcs/rfc6121.html>} (XMPP IM).
     
    9898 from twisted.internet import defer
    9999+from twisted.python import log
     100 from twisted.words.protocols.jabber import error
    100101 from twisted.words.protocols.jabber import jid
    101  from twisted.words.protocols.jabber import error
    102102 from twisted.words.xish import domish
    103 @@ -168,7 +171,10 @@
    104          self.xmlstream.addObserver("/presence", self._onPresence)
     103@@ -179,10 +182,7 @@
     104 
    105105 
    106106 
    107107-    def _onPresence(self, element):
     108-        """
     109-        Called when a presence stanza has been received.
     110-        """
    108111+    def parsePresence(self, element):
    109 +        """
    110 +        Parse presence.
    111 +        """
    112112         stanza = Stanza.fromElement(element)
    113113 
    114114         presenceType = stanza.stanzaType or 'available'
    115 @@ -178,14 +184,19 @@
     115@@ -192,14 +192,22 @@
    116116         except KeyError:
    117117             return
     
    122122+
    123123+    def _onPresence(self, element):
     124+        """
     125+        Called when a presence stanza has been received.
     126+        """
    124127+        presence = self.parsePresence(element)
    125128+        presenceType = presence.stanzaType or 'available'
     
    134137 
    135138 
    136      def errorReceived(self, presence):
    137 @@ -553,6 +564,440 @@
     139 
     140@@ -582,6 +590,440 @@
    138141 
    139142 
     
    576579     """
    577580     XMPP subprotocol handler for the roster, server side.
    578 diff -r 9e8497278e0e wokkel/test/test_im.py
    579 --- a/wokkel/test/test_im.py    Thu Oct 06 18:47:41 2011 +0200
    580 +++ b/wokkel/test/test_im.py    Thu Oct 06 18:55:13 2011 +0200
     581diff -r 24c6e79ab1c4 wokkel/test/test_im.py
     582--- a/wokkel/test/test_im.py    Wed Mar 28 13:22:34 2012 +0200
     583+++ b/wokkel/test/test_im.py    Wed Mar 28 13:23:36 2012 +0200
    581584@@ -13,7 +13,7 @@
    582585 from twisted.words.xish import domish, utility
  • client_listen_authenticator.patch

    r54 r57  
    11# HG changeset patch
    2 # Parent 661689a96e34ac375d95c612d36d959eee3927a9
     2# Parent 75701188facc278f61a0dfb4bcfcd2232ee771ca
    33Add authenticator for accepting XMPP client connections.
    44
     
    2121 * Support for multiple domains?
    2222
    23 diff -r 661689a96e34 wokkel/client.py
    24 --- a/wokkel/client.py  Wed Oct 05 09:40:15 2011 +0200
    25 +++ b/wokkel/client.py  Wed Oct 05 09:50:55 2011 +0200
    26 @@ -10,14 +10,24 @@
     23diff -r 75701188facc wokkel/client.py
     24--- a/wokkel/client.py  Wed Nov 23 09:52:41 2011 +0100
     25+++ b/wokkel/client.py  Wed Nov 30 09:31:07 2011 +0100
     26@@ -10,14 +10,26 @@
    2727 that should probably eventually move there.
    2828 """
     
    3232 from twisted.application import service
    3333 from twisted.internet import reactor
     34+from twisted.python import log
    3435 from twisted.names.srvconnect import SRVConnector
    3536-from twisted.words.protocols.jabber import client, sasl, xmlstream
    3637+from twisted.words.protocols.jabber import client, error, sasl, xmlstream
     38+from twisted.words.xish import domish
    3739 
    3840 from wokkel import generic
     
    5052     """
    5153     Check what authentication methods are available.
    52 @@ -51,7 +61,7 @@
     54@@ -51,7 +63,7 @@
    5355     autentication.
    5456     """
     
    5961     def __init__(self, jid, password):
    6062         xmlstream.ConnectAuthenticator.__init__(self, jid.host)
    61 @@ -186,3 +196,152 @@
     63@@ -186,3 +198,152 @@
    6264     c = XMPPClientConnector(reactor, domain, factory)
    6365     c.connect()
  • copy_xmppim.patch

    r49 r57  
    11# HG changeset patch
    2 # Parent 2c8dc93fbef4f2d5b7115c7afdd1b7fb799d47c3
     2# Parent 4ce55e7a3bb2f881333a4c61e215ffd2e3248695
    33
    44diff --git a/wokkel/xmppim.py b/wokkel/im.py
     
    242242     """
    243243     Stanza of kind presence.
    244 @@ -605,6 +377,7 @@
     244@@ -633,6 +405,7 @@
    245245         self.groups = set()
    246246 
     
    250250     """
    251251     Client side XMPP roster protocol.
    252 @@ -614,6 +387,7 @@
     252@@ -642,6 +415,7 @@
    253253         ROSTER_SET = "/iq[@type='set']/query[@xmlns='%s']" % NS_ROSTER
    254254         self.xmlstream.addObserver(ROSTER_SET, self._onRosterSet)
     
    258258         jid = JID(element['jid'])
    259259         item = RosterItem(jid)
    260 @@ -628,6 +402,7 @@
     260@@ -656,6 +430,7 @@
    261261 
    262262         return item
     
    266266         """
    267267         Retrieve contact list.
    268 @@ -683,6 +458,7 @@
     268@@ -711,6 +486,7 @@
    269269             item = self._parseRosterItem(iq.query.item)
    270270             self.onRosterSet(item)
     
    274274         """
    275275         Called when a roster push for a new or update item was received.
    276 @@ -691,6 +467,7 @@
     276@@ -719,6 +495,7 @@
    277277         @type item: L{RosterItem}
    278278         """
     
    282282         """
    283283         Called when a roster push for the removal of an item was received.
    284 @@ -698,32 +475,3 @@
    285          @param entity: The entity for which the roster item has been removed.
    286          @type entity: L{JID}
    287          """
     284@@ -764,34 +541,3 @@
     285             element.addElement('subject', content=self.subject)
     286 
     287         return element
     288-
     289-
    288290-
    289291-class MessageProtocol(XMPPHandler):
  • disco_warning.patch

    r47 r57  
    11# HG changeset patch
    2 # Parent 2d57501b5c68d776489bdb9558b41c446c7c56f1
    3 diff -r 2d57501b5c68 -r f9bd41295efe wokkel/pubsub.py
    4 --- a/wokkel/pubsub.py  Fri Feb 18 20:38:19 2011 +0100
    5 +++ b/wokkel/pubsub.py  Sat Feb 19 08:35:11 2011 +0100
     2# Parent 46b33f13f14214ec900a189348a21824d915212a
     3
     4diff -r 46b33f13f142 wokkel/pubsub.py
     5--- a/wokkel/pubsub.py  Wed Mar 28 13:24:00 2012 +0200
     6+++ b/wokkel/pubsub.py  Wed Mar 28 13:24:14 2012 +0200
    67@@ -10,6 +10,8 @@
    7  U{XEP-0060<http://www.xmpp.org/extensions/xep-0060.html>}.
     8 U{XEP-0060<http://xmpp.org/extensions/xep-0060.html>}.
    89 """
    910 
     
    1314 
    1415 from twisted.internet import defer
    15 @@ -1091,6 +1093,8 @@
     16@@ -1103,6 +1105,8 @@
    1617             if not nodeInfo:
    1718                 return
  • pubsub-default-type-attribute.patch

    r47 r57  
    11# HG changeset patch
    2 # Parent fc34b2a3eee92201a08dd633aeccf75724305c88
     2# Parent a1fb8edead3376a4c5ec2f75f1922aaf7af3c8c8
    33
    4 diff -r fc34b2a3eee9 wokkel/pubsub.py
    5 --- a/wokkel/pubsub.py  Mon Feb 28 09:28:29 2011 +0100
    6 +++ b/wokkel/pubsub.py  Mon Feb 28 09:31:16 2011 +0100
    7 @@ -385,12 +385,7 @@
     4diff -r a1fb8edead33 wokkel/pubsub.py
     5--- a/wokkel/pubsub.py  Wed Mar 28 13:31:48 2012 +0200
     6+++ b/wokkel/pubsub.py  Wed Mar 28 13:33:10 2012 +0200
     7@@ -424,12 +424,7 @@
    88         """
    99         Parse node type out of a request for the default node configuration.
    1010         """
    1111-        form = data_form.findForm(verbElement, NS_PUBSUB_NODE_CONFIG)
    12 -        if form and form.formType == 'submit':
     12-        if form is not None and form.formType == 'submit':
    1313-            values = form.getValues()
    1414-            self.nodeType = values.get('pubsub#node_type', 'leaf')
     
    1919 
    2020     def _parse_configure(self, verbElement):
    21 diff -r fc34b2a3eee9 wokkel/test/test_pubsub.py
    22 --- a/wokkel/test/test_pubsub.py        Mon Feb 28 09:28:29 2011 +0100
    23 +++ b/wokkel/test/test_pubsub.py        Mon Feb 28 09:31:16 2011 +0100
    24 @@ -1688,17 +1688,7 @@
     21diff -r a1fb8edead33 wokkel/test/test_pubsub.py
     22--- a/wokkel/test/test_pubsub.py        Wed Mar 28 13:31:48 2012 +0200
     23+++ b/wokkel/test/test_pubsub.py        Wed Mar 28 13:33:10 2012 +0200
     24@@ -1712,17 +1712,7 @@
    2525         <iq type='get' to='pubsub.example.org'
    2626                        from='user@example.org'>
     
    4141         </iq>
    4242         """
    43 @@ -2668,6 +2658,7 @@
     43@@ -2692,6 +2682,7 @@
    4444             return fieldDefs
    4545 
     
    4949                                   'x-myfield': '1'})
    5050 
    51 @@ -2701,17 +2692,7 @@
     51@@ -2725,17 +2716,7 @@
    5252         <iq type='get' to='pubsub.example.org'
    5353                        from='user@example.org'>
  • pubsub-item.patch

    r47 r57  
    1 diff -r d16bd03316ad wokkel/generic.py
    2 --- a/wokkel/generic.py Mon Feb 28 09:31:41 2011 +0100
    3 +++ b/wokkel/generic.py Mon Feb 28 09:43:34 2011 +0100
    4 @@ -38,13 +38,12 @@
     1diff -r 2bc0db311133 wokkel/generic.py
     2--- a/wokkel/generic.py Wed Mar 28 13:28:55 2012 +0200
     3+++ b/wokkel/generic.py Wed Mar 28 13:30:27 2012 +0200
     4@@ -34,13 +34,12 @@
    55     @return: The DOM structure, or C{None} on empty or incomplete input.
    66     @rtype: L{domish.Element}
     
    2020 
    2121 
    22 diff -r d16bd03316ad wokkel/pubsub.py
    23 --- a/wokkel/pubsub.py  Mon Feb 28 09:31:41 2011 +0100
    24 +++ b/wokkel/pubsub.py  Mon Feb 28 09:43:34 2011 +0100
     22diff -r 2bc0db311133 wokkel/pubsub.py
     23--- a/wokkel/pubsub.py  Wed Mar 28 13:28:55 2012 +0200
     24+++ b/wokkel/pubsub.py  Wed Mar 28 13:30:27 2012 +0200
    2525@@ -157,33 +157,56 @@
    2626 
     
    6161         """
    6262-        @param id: optional item identifier
    63 -        @type id: L{unicode}
     63-        @type id: C{unicode}
    6464-        @param payload: optional item payload. Either as a domish element, or
    6565-                        as serialized XML.
    66 -        @type payload: object providing L{domish.IElement} or L{unicode}.
     66-        @type payload: object providing L{domish.IElement} or C{unicode}.
    6767+        Render to a DOM representation.
    6868+
     
    9898 
    9999 
    100 @@ -351,7 +374,13 @@
     100@@ -362,7 +385,13 @@
    101101         self.items = []
    102102         for element in verbElement.elements():
     
    113113 
    114114     def _render_items(self, verbElement):
    115 @@ -360,8 +389,7 @@
     115@@ -371,8 +400,7 @@
    116116         """
    117117         if self.items:
     
    123123 
    124124     def _parse_jid(self, verbElement):
    125 @@ -1307,8 +1335,7 @@
     125@@ -1319,8 +1347,7 @@
    126126         items["node"] = request.nodeIdentifier
    127127 
     
    133133         return response
    134134 
    135 @@ -1359,8 +1386,7 @@
     135@@ -1371,8 +1398,7 @@
    136136                                                nodeIdentifier, subscriber,
    137137                                                subscriptions)
     
    143143 
    144144 
    145 diff -r d16bd03316ad wokkel/test/test_pubsub.py
    146 --- a/wokkel/test/test_pubsub.py        Mon Feb 28 09:31:41 2011 +0100
    147 +++ b/wokkel/test/test_pubsub.py        Mon Feb 28 09:43:34 2011 +0100
     145diff -r 2bc0db311133 wokkel/test/test_pubsub.py
     146--- a/wokkel/test/test_pubsub.py        Wed Mar 28 13:28:55 2012 +0200
     147+++ b/wokkel/test/test_pubsub.py        Wed Mar 28 13:30:27 2012 +0200
    148148@@ -115,6 +115,30 @@
    149149 
  • roster_item.patch

    r54 r57  
    1414   return a `service-unavailable` stanza error.
    1515
    16 diff -r 2e2717d3db8f wokkel/im.py
    17 --- a/wokkel/im.py      Wed Oct 05 09:15:44 2011 +0200
    18 +++ b/wokkel/im.py      Wed Oct 05 09:29:18 2011 +0200
    19 @@ -7,21 +7,25 @@
     16diff -r a3c50205821b wokkel/im.py
     17--- a/wokkel/im.py      Wed Mar 28 13:13:06 2012 +0200
     18+++ b/wokkel/im.py      Wed Mar 28 13:17:05 2012 +0200
     19@@ -7,21 +7,26 @@
    2020 XMPP IM protocol support.
    2121 
    2222 This module provides generic implementations for the protocols defined in
    23 -U{RFC 3921<http://www.xmpp.org/rfcs/rfc3921.html>} (XMPP IM).
     23-U{RFC 3921<http://xmpp.org/rfcs/rfc3921.html>} (XMPP IM).
    2424-
    2525-All of it should eventually move to Twisted.
     
    2828 
    2929+from twisted.internet import defer
     30+from twisted.words.protocols.jabber import error
    3031 from twisted.words.protocols.jabber import jid
    31 +from twisted.words.protocols.jabber import error
    3232 from twisted.words.xish import domish
    3333 
    3434 from wokkel.compat import IQ
    3535 from wokkel.generic import ErrorStanza, Stanza
    36 -from wokkel.subprotocols import XMPPHandler
    37 +from wokkel.subprotocols import IQHandlerMixin, XMPPHandler
     36+from wokkel.subprotocols import IQHandlerMixin
     37 from wokkel.subprotocols import XMPPHandler
    3838 
    3939 NS_XML = 'http://www.w3.org/XML/1998/namespace'
     
    4747     """
    4848     Stanza of kind presence.
    49 @@ -349,8 +353,8 @@
     49@@ -377,8 +382,8 @@
    5050 
    5151     This represents one contact from an XMPP contact list known as roster.
     
    5858     @type name: C{unicode}
    5959     @ivar subscriptionTo: Subscription state to contact's presence. If C{True},
    60 @@ -360,47 +364,99 @@
     60@@ -388,47 +393,99 @@
    6161     @ivar subscriptionFrom: Contact's subscription state. If C{True}, the
    6262                             contact is subscribed to the presence information
     
    186186 
    187187     def getRoster(self):
    188 @@ -415,8 +471,8 @@
     188@@ -443,8 +500,8 @@
    189189             roster = {}
    190190             for element in domish.generateElementsQNamed(result.query.children,
     
    197197             return roster
    198198 
    199 @@ -437,32 +493,36 @@
     199@@ -465,32 +522,36 @@
    200200         """
    201201         iq = IQ(self.xmlstream, 'set')
     
    247247         @type item: L{RosterItem}
    248248         """
    249 @@ -472,6 +532,10 @@
     249@@ -500,6 +561,10 @@
    250250         """
    251251         Called when a roster push for the removal of an item was received.
     
    258258         @type entity: L{jid.JID}
    259259         """
    260 diff -r 2e2717d3db8f wokkel/test/test_im.py
    261 --- a/wokkel/test/test_im.py    Wed Oct 05 09:15:44 2011 +0200
    262 +++ b/wokkel/test/test_im.py    Wed Oct 05 09:29:18 2011 +0200
     260diff -r a3c50205821b wokkel/test/test_im.py
     261--- a/wokkel/test/test_im.py    Wed Mar 28 13:13:06 2012 +0200
     262+++ b/wokkel/test/test_im.py    Wed Mar 28 13:17:05 2012 +0200
    263263@@ -7,13 +7,14 @@
    264264 
  • router_unknown.patch

    r54 r57  
    11# HG changeset patch
    2 # Parent 28a032eab8a5ffbc145aaec1f0044a2a9cad7058
     2# Parent 3d3065a425fa27c45c1f25aae8910f282f3049a4
    33Send back an error if there is no known route to the stanza's destination.
    44
     
    66component that acts as the default route (indexed by `None`).
    77
    8 diff -r 28a032eab8a5 wokkel/component.py
    9 --- a/wokkel/component.py       Wed Oct 05 09:38:30 2011 +0200
    10 +++ b/wokkel/component.py       Wed Oct 05 09:40:15 2011 +0200
    11 @@ -313,12 +313,25 @@
     8diff -r 3d3065a425fa wokkel/component.py
     9--- a/wokkel/component.py       Wed Mar 28 13:34:30 2012 +0200
     10+++ b/wokkel/component.py       Wed Mar 28 13:36:55 2012 +0200
     11@@ -332,12 +332,24 @@
    1212         """
    1313         destination = JID(stanza['to'])
     
    1616 
    1717         if destination.host in self.routes:
    18 +            msg = "Routing to %s (default route): %r"
    1918+            log.msg("Routing to %s: %r" % (destination.full(),
    2019+                                           stanza.toXml()))
  • series

    r56 r57  
    1 release-0.7.0.patch
    21pubsub_client_example.patch
    32
  • session_manager.patch

    r54 r57  
    11# HG changeset patch
    2 # Parent c991ebbd42bee47f273d214a4dc9f6665ed7d5ec
     2# Parent 4e25d6deb8beeb732cadb38349ee820f0dc98b3a
    33
    4 diff -r c991ebbd42be wokkel/client.py
    5 --- a/wokkel/client.py  Wed Oct 05 09:58:11 2011 +0200
    6 +++ b/wokkel/client.py  Wed Oct 05 09:58:17 2011 +0200
    7 @@ -13,14 +13,16 @@
     4diff -r 4e25d6deb8be wokkel/client.py
     5--- a/wokkel/client.py  Wed Nov 30 09:32:01 2011 +0100
     6+++ b/wokkel/client.py  Wed Nov 30 09:33:11 2011 +0100
     7@@ -13,15 +13,16 @@
    88 import base64
    99 
    1010 from twisted.application import service
    1111-from twisted.internet import reactor
     12-from twisted.python import log
    1213+from twisted.internet import defer, reactor
     14+from twisted.python import log, randbytes
    1315 from twisted.names.srvconnect import SRVConnector
    14 +from twisted.python import log, randbytes
    1516 from twisted.words.protocols.jabber import client, error, sasl, xmlstream
     17-from twisted.words.xish import domish
    1618+from twisted.words.protocols.jabber.jid import JID, internJID
    17  from twisted.words.xish import domish, utility
     19+from twisted.words.xish import domish, utility
    1820 
    1921 from wokkel import generic
     22 from wokkel.compat import XmlStreamServerFactory
    2023-from wokkel.subprotocols import StreamManager
    21  from wokkel.compat import XmlStreamServerFactory
    2224+from wokkel.subprotocols import StreamManager, XMPPHandler
    2325 
    2426 NS_CLIENT = 'jabber:client'
    2527 
    26 @@ -442,3 +444,105 @@
     28@@ -443,3 +444,105 @@
    2729         else:
    2830             raise RecipientUnavailable(u"There is no connection for %s" %
Note: See TracChangeset for help on using the changeset viewer.