Changeset 53:4aec395fda5b
- Timestamp:
- Apr 7, 2009, 12:13:08 PM (13 years ago)
- Branch:
- default
- Convert:
- svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@165
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LICENSE
r19 r53 1 Copyright (c) 2003-200 8Ralph Meijer1 Copyright (c) 2003-2009 Ralph Meijer 2 2 3 3 Permission is hereby granted, free of charge, to any person obtaining -
NEWS
r31 r53 1 0.5.0 (2009-04-07) 2 ================== 3 4 This release drops support for Twisted versions older than 8.0, including 5 Twisted 2.5 / Twisted Words 0.5. 6 7 Features 8 -------- 9 10 - Support for sending and receiving Publish-Subscribe node delete 11 notifications with redirect. 12 - Service Discovery client support, including an overhaul of disco data 13 classes (#28). 14 - Initial support for building XMPP servers has been added: 15 - XmlStreamServerFactory has been backported from Twisted Words (#29). 16 - An XMPP router has been added (#30). 17 - A server-side component authenticator has been added (#30). 18 - A new server-side component service, that connects to a router within the 19 same process, was added (#31). 20 21 22 Fixes 23 ----- 24 25 - Publish-Subscribe subscriptions requests work again (#22). 26 - Publish-Subscribe delete node requests now have the correct namespace (#27). 27 - NodeIDs in Service Discovery requests are now returned in responses (#7). 28 - The presence of stanzaType in toResponse is now checked correctly (#34). 29 - Data Form fields are now rendered depending on form type (#40). 30 - Data Form type checking issues were addressed (#41). 31 - Some compatibility fixes for Twisted 8.0 and 8.1. 32 - Various other fixes (#37, #42) and tracking changes to code already in 33 Twisted. 34 35 1 36 0.4.0 (2008-08-05) 2 37 ================== -
README
r31 r53 1 Wokkel 0. 4.01 Wokkel 0.5.0 2 2 3 3 What is this? 4 4 ============= 5 5 6 Wokkel is a Python module for experimenting with future enhancements 7 to Twisted Words. Everything is aimed to be included in the Twisted 8 main development tree eventually. 6 Wokkel is a Python module for experimenting with future enhancements to Twisted 7 Words, that should eventually be included in the main Twisted main development 8 tree. Some of the code in Wokkel has already made that transition, but is still 9 included to be used with older Twisted releases. 9 10 10 Dependencies 11 12 Requirements 11 13 ============ 12 14 13 This module depends on Twisted Words 0.5 or later. 15 - Python 2.4 or later. 16 - Twisted 8.0.0 or later. 14 17 15 Copyright 18 19 Resources 16 20 ========= 17 21 18 The code in this distribution is Copyright (c) 2003-2008 Ralph Meijer, unless 22 Wokkel's home is <http://wokkel.ik.nu/>. 23 24 Besides the general Twisted resources, help is available on the Twisted-Jabber 25 mailing list:: 26 27 <https://mailman.ik.nu/mailman/listinfo/twisted-jabber> 28 29 30 Copyright and Warranty 31 ====================== 32 33 The code in this distribution is Copyright (c) 2003-2009 Ralph Meijer, unless 19 34 excplicitely specified otherwise. 20 35 … … 22 37 describes this in detail. 23 38 24 Contact25 =======26 39 27 Questions, comments or suggestions are welcome! 40 Contributors 41 ============ 42 43 - Christopher Zorn 44 - Jack Moffitt 45 - Mike Malone 46 - Pablo Martin 47 48 49 Author 50 ====== 28 51 29 52 Ralph Meijer -
setup.py
r31 r53 1 1 #!/usr/bin/env python 2 2 3 # Copyright (c) 2003-200 8Ralph Meijer3 # Copyright (c) 2003-2009 Ralph Meijer 4 4 # See LICENSE for details. 5 5 … … 7 7 8 8 setup(name='wokkel', 9 version='0. 4.0',9 version='0.5.0', 10 10 description='Twisted Jabber support library', 11 11 author='Ralph Meijer', -
wokkel/compat.py
r44 r53 7 7 from twisted.words.protocols.jabber import xmlstream 8 8 from twisted.words.xish import domish 9 10 def toResponse(stanza, stanzaType=None):11 """12 Create a response stanza from another stanza.13 14 This takes the addressing and id attributes from a stanza to create a (new,15 empty) response stanza. The addressing attributes are swapped and the id16 copied. Optionally, the stanza type of the response can be specified.17 18 @param stanza: the original stanza19 @type stanza: L{domish.Element}20 @param stanzaType: optional response stanza type21 @type stanzaType: C{str}22 @return: the response stanza.23 @rtype: L{domish.Element}24 """25 26 toAddr = stanza.getAttribute('from')27 fromAddr = stanza.getAttribute('to')28 stanzaID = stanza.getAttribute('id')29 30 response = domish.Element((None, stanza.name))31 if toAddr:32 response['to'] = toAddr33 if fromAddr:34 response['from'] = fromAddr35 if stanzaID:36 response['id'] = stanzaID37 if stanzaType:38 response['type'] = stanzaType39 40 return response41 42 43 9 44 10 class BootstrapMixin(object): -
wokkel/subprotocols.py
r45 r53 1 1 # -*- test-case-name: wokkel.test.test_subprotocols -*- 2 2 # 3 # Copyright (c) 2001-200 7Twisted Matrix Laboratories.3 # Copyright (c) 2001-2009 Twisted Matrix Laboratories. 4 4 # See LICENSE for details. 5 5 … … 13 13 from twisted.python import log 14 14 from twisted.words.protocols.jabber import error, xmlstream 15 from twisted.words.protocols.jabber.xmlstream import toResponse 15 16 from twisted.words.xish import xpath 16 17 from twisted.words.xish.domish import IElement 17 18 try:19 from twisted.words.protocols.jabber.xmlstream import toResponse20 except ImportError:21 from wokkel.compat import toResponse22 18 23 19 from wokkel.iwokkel import IXMPPHandler, IXMPPHandlerCollection -
wokkel/test/test_compat.py
r44 r53 1 # Copyright (c) 2001-200 7Twisted Matrix Laboratories.2 # Copyright (c) 2008 Ralph Meijer1 # Copyright (c) 2001-2008 Twisted Matrix Laboratories. 2 # Copyright (c) 2008-2009 Ralph Meijer 3 3 # See LICENSE for details. 4 4 … … 13 13 from twisted.words.xish import domish, utility 14 14 from twisted.words.protocols.jabber import xmlstream 15 from wokkel.compat import toResponse,BootstrapMixin, XmlStreamServerFactory15 from wokkel.compat import BootstrapMixin, XmlStreamServerFactory 16 16 17 17 class DummyProtocol(protocol.Protocol, utility.EventDispatcher): … … 78 78 dispatcher.dispatch(None, '//event/myevent') 79 79 self.assertFalse(called) 80 81 82 83 class ToResponseTest(unittest.TestCase):84 85 def test_toResponse(self):86 """87 Test that a response stanza is generated with addressing swapped.88 """89 stanza = domish.Element(('jabber:client', 'iq'))90 stanza['type'] = 'get'91 stanza['to'] = 'user1@example.com'92 stanza['from'] = 'user2@example.com/resource'93 stanza['id'] = 'stanza1'94 response = toResponse(stanza, 'result')95 self.assertNotIdentical(stanza, response)96 self.assertEqual(response['from'], 'user1@example.com')97 self.assertEqual(response['to'], 'user2@example.com/resource')98 self.assertEqual(response['type'], 'result')99 self.assertEqual(response['id'], 'stanza1')100 101 def test_toResponseNoFrom(self):102 """103 Test that a response is generated from a stanza without a from address.104 """105 stanza = domish.Element(('jabber:client', 'iq'))106 stanza['type'] = 'get'107 stanza['to'] = 'user1@example.com'108 response = toResponse(stanza)109 self.assertEqual(response['from'], 'user1@example.com')110 self.failIf(response.hasAttribute('to'))111 112 def test_toResponseNoTo(self):113 """114 Test that a response is generated from a stanza without a to address.115 """116 stanza = domish.Element(('jabber:client', 'iq'))117 stanza['type'] = 'get'118 stanza['from'] = 'user2@example.com/resource'119 response = toResponse(stanza)120 self.failIf(response.hasAttribute('from'))121 self.assertEqual(response['to'], 'user2@example.com/resource')122 123 def test_toResponseNoAddressing(self):124 """125 Test that a response is generated from a stanza without any addressing.126 """127 stanza = domish.Element(('jabber:client', 'message'))128 stanza['type'] = 'chat'129 response = toResponse(stanza)130 self.failIf(response.hasAttribute('to'))131 self.failIf(response.hasAttribute('from'))132 133 def test_noID(self):134 """135 Test that a proper response is generated without id attribute.136 """137 stanza = domish.Element(('jabber:client', 'message'))138 response = toResponse(stanza)139 self.failIf(response.hasAttribute('id'))140 141 142 def test_noType(self):143 """144 Test that a proper response is generated without type attribute.145 """146 stanza = domish.Element(('jabber:client', 'message'))147 response = toResponse(stanza)148 self.failIf(response.hasAttribute('type'))149 80 150 81 -
wokkel/test/test_disco.py
r49 r53 11 11 from twisted.trial import unittest 12 12 from twisted.words.protocols.jabber.jid import JID 13 from twisted.words.protocols.jabber.xmlstream import toResponse 13 14 from twisted.words.xish import domish 14 15 … … 17 18 from wokkel.subprotocols import XMPPHandler 18 19 from wokkel.test.helpers import TestableRequestHandlerMixin, XmlStreamStub 19 20 try:21 from twisted.words.protocols.jabber.xmlstream import toResponse22 except ImportError:23 from wokkel.compat import toResponse24 20 25 21 NS_DISCO_INFO = 'http://jabber.org/protocol/disco#info' -
wokkel/test/test_pubsub.py
r52 r53 1 # Copyright (c) 2003-200 8Ralph Meijer1 # Copyright (c) 2003-2009 Ralph Meijer 2 2 # See LICENSE for details. 3 3 … … 13 13 from twisted.words.protocols.jabber import error 14 14 from twisted.words.protocols.jabber.jid import JID 15 from twisted.words.protocols.jabber.xmlstream import toResponse 15 16 16 17 from wokkel import data_form, disco, iwokkel, pubsub, shim 17 18 from wokkel.test.helpers import TestableRequestHandlerMixin, XmlStreamStub 18 19 try:20 from twisted.words.protocols.jabber.xmlstream import toResponse21 except ImportError:22 from wokkel.compat import toResponse23 19 24 20 NS_PUBSUB = 'http://jabber.org/protocol/pubsub'
Note: See TracChangeset
for help on using the changeset viewer.