--- python-xmpp-0.4.1.orig/README +++ python-xmpp-0.4.1/README @@ -1,13 +1,12 @@ Introduction to xmpppy. http://xmpppy.sf.net/ - This is my work to replace the jabberpy with the current and maintained -project. - Now the project nears feature freese of 0.2 branch. Almost all goals are -achieved already. Though the main goal was to write a documentation - at least -a line for every feature of library. Yesterday I have checked in last docstrings -for all yet undocumented modules and now I can say that this issue is resolved -(at least for 0.2 release level). + This project aims for providing easy scripting for xmpp-enabled +applications. ATM (May 2008) the project is in maintance mode, alsmost +no new code is added so you can consider it to be stable, especially as +most of bugs were fixed over last years. If you miss some feature - you +can also check out sources of Gajim client that is based upon this library +but maintains it's own branch of it. Documentation exists in three formats. - The first is the examples that I wrote to show xmpppy in action. This is two simple scripts - README.py and xsend.py. @@ -17,27 +16,27 @@ should work too (at least the pydoc works) Installation -If you are using Debian (sarge or above) you can simply run +If you are using Debian or Ubuntu you can simply run apt-get install python-xmpp -and you will get the current stable release of xmpppy installed. After installation -you can do 'import xmpp'. Though currently debian contains 0.1 release of xmpppy so -if you want to use 0.2 branch you should install it manually (python2.3 required). +and you will get the current stable release of xmpppy installed. After +installation you can do 'import xmpp'. In case there is newer version released +that is not included into your distro - you can always install it manually. Here you have several options: - run 'python setup.py install' from xmpppy distribution as root. All should work nice. - if you don't like python installator - just copy xmpp directory into python's site-packages directory (this is what setup.py does). - - If you have no intention to install library system-wide (or just have no - privileges to do it) you can copy xmpp directory just in your application's - directory. Example: - myxmpppytry/ + - If you have no intention to install library system-wide (or just don't + have no enough permissions to do it) you can copy xmpp directory to + your application's directory. Example: + myxmpptry/ xmpp/ ...xmpppy modules test.py -If you have any questions about xmpppy usage or you have find a bug or want -to share some ideas - you are welcome in xmpppy-devel maillist - see +If you have any questions about xmpppy usage or found a bug or want +to share some ideas - you are welcome to xmpppy-devel maillist - see http://lists.sourceforge.net/lists/listinfo/xmpppy-devel for details of subscription. -2004.12.26 Alexey Nezhdanov +2008.05.05 Alexey Nezhdanov --- python-xmpp-0.4.1.orig/debian/changelog +++ python-xmpp-0.4.1/debian/changelog @@ -0,0 +1,153 @@ +python-xmpp (0.4.1-cvs20080505.3build1) trusty; urgency=medium + + * Rebuild to drop files installed into /usr/share/pyshared. + + -- Matthias Klose Sun, 23 Feb 2014 13:53:39 +0000 + +python-xmpp (0.4.1-cvs20080505.3) unstable; urgency=low + + * Non-maintainer upload. + * Convert to dh_python2 (Closes: #617045). + + -- Andrea Colangelo Wed, 26 Jun 2013 10:30:54 +0200 + +python-xmpp (0.4.1-cvs20080505.2) unstable; urgency=low + + * NMU. + * Rebuild to move files to /usr/share/pyshared. Closes: #490504. + + -- Matthias Klose Sun, 13 Jul 2008 02:27:53 +0200 + +python-xmpp (0.4.1-cvs20080505.1) unstable; urgency=low + + * Non-Maintainer Upload + * Debian README updated. + * License clarified as GPL2+ (Closes: #469537) + * Package update to last released version (Closes: #473178) + * Latest CVS fixes applied to: + auth.py - sasl auth bugfix (Closes: #469028) + transports.py - bugfix in proxy connections support + jep0106.py - added test cases + + -- Alexey Nezhdanov Mon, 05 May 2008 14:40:53 +0400 + +python-xmpp (0.3.1-1.2) unstable; urgency=low + + * Non-maintainer upload. + * Fixed bashism (declare -x) in debian/rules (Closes: 445783) - patch from + dAniel hAhler. + * Applied patch from Micha Lenk to improve description. (Closes: #381360) + + -- Lucas Nussbaum Wed, 16 Jan 2008 09:07:59 +0100 + +python-xmpp (0.3.1-1.1) unstable; urgency=low + + * NMU. + * Convert to updated Python policy. Closes: #373369. + + -- Matthias Klose Thu, 6 Jul 2006 14:29:59 +0000 + +python-xmpp (0.3.1-1) unstable; urgency=low + + * New upstream release + * Added dependency to python-dns package. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Sat, 25 Mar 2006 09:35:32 +0300 + +python-xmpp (0.3-1) unstable; urgency=low + + * New upstream release + * Update of python2.3-xmpp for debian/testing required. + Closes: #312227 + * Please stop build modules for python2.1/python2.2 + closes: #351154 + * New Upstream available (0.3). Closes: #356149 + * /usr/lib/python2.3/site-packages/xmpp/features.py: error in + setPrivacyList. Closes: #321348 + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Mon, 13 Mar 2006 09:40:17 +0300 + +python-xmpp (0.2-rc3-1) unstable; urgency=low + + * Sync with latest released version. + closes: #307988 + * Added bugfixes from current CVS. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Thu, 12 May 2005 11:41:34 +0400 + +python-xmpp (0.2-rc2-1) unstable; urgency=low + + * Sync with latest released version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Wed, 4 May 2005 20:51:11 +0400 + +python-xmpp (0.2-rc1-1) unstable; urgency=low + + * Sync with latest released version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Fri, 11 Mar 2005 20:45:54 +0300 + +python-xmpp (0.1.1-1) unstable; urgency=low + + * Sync with latest released version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Sat, 25 Sep 2004 08:22:52 +0400 + +python-xmpp (0.1-rc4-1) unstable; urgency=low + + * Sync with latest released version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Thu, 5 Aug 2004 19:31:08 +0400 + +python-xmpp (0.1-rc3-2) unstable; urgency=low + + * Added bugfixes from CVS version. + * Generated and added changelog. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Sun, 27 Jun 2004 11:26:31 +0400 + +python-xmpp (0.1-rc3-1) unstable; urgency=low + + * Sync with latest released version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Thu, 24 Jun 2004 06:51:06 +0400 + +python-xmpp (0.1-rc2-2) unstable; urgency=low + + * Added bugfixes from CVS version. + * Added python to "Build-Depends". Closes: #254368 + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Tue, 15 Jun 2004 09:09:01 +0400 + +python-xmpp (0.1-rc2-1) unstable; urgency=low + + * Sync with latest released version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Fri, 28 May 2004 23:39:31 +0400 + +python-xmpp (0.1-rc1-1) unstable; urgency=low + + * Sync with latest released version. + * Closes ITP + closes: #246560 + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Tue, 4 May 2004 11:59:56 +0400 + +python-xmpp (0.1-pre4-1) unstable; urgency=low + + * Initial Release. + + -- Alexey Nezhdanov Sat, 28 Feb 2004 10:40:47 +0300 + --- python-xmpp-0.4.1.orig/debian/compat +++ python-xmpp-0.4.1/debian/compat @@ -0,0 +1 @@ +5 --- python-xmpp-0.4.1.orig/debian/control +++ python-xmpp-0.4.1/debian/control @@ -0,0 +1,23 @@ +Source: python-xmpp +Section: python +Priority: optional +Maintainer: Alexey Nezhdanov +Build-Depends: debhelper (>= 5.0.37.2) +Build-Depends-Indep: python (>= 2.6.6-3~) +Standards-Version: 3.8.0 +Uploaders: Cosimo Alfarano + +Package: python-xmpp +Architecture: all +Depends: ${python:Depends} +Conflicts: python2.3-xmpp, python2.4-xmpp, jabber-irc (<< 0.2) +Replaces: python2.3-xmpp, python2.4-xmpp +Recommends: python-dnspython | python-dnspython +Description: Python library for communication with XMPP (Jabber) servers + This is a set of modules providing functionality for writing + XMPP-compliant clients or server components in Python. + . + This library was initially designed as "rework" of jabberpy library + but lately become a separate product. + . + Unlike jabberpy it is distributed under the terms of GPL. --- python-xmpp-0.4.1.orig/debian/copyright +++ python-xmpp-0.4.1/debian/copyright @@ -0,0 +1,31 @@ +This package was written and debianized by +Alexey Nezhdanov +on Sat, 28 Feb 2004 10:40:47 +0300. + +Library contained in this package is a fork of jabberpy library. +For more info visit: +http://xmpppy.sourceforge.net/ +http://jabberpy.sourceforge.net/ + +Copyright: 2003-2008 Alexey Nezhdanov + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- python-xmpp-0.4.1.orig/debian/python-xmpp.docs +++ python-xmpp-0.4.1/debian/python-xmpp.docs @@ -0,0 +1,2 @@ +README +html --- python-xmpp-0.4.1.orig/debian/python-xmpp.examples +++ python-xmpp-0.4.1/debian/python-xmpp.examples @@ -0,0 +1 @@ +examples/*.py --- python-xmpp-0.4.1.orig/debian/rules +++ python-xmpp-0.4.1/debian/rules @@ -0,0 +1,90 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# python version for which a pkg will be build +PYVERSIONS= $(shell pyversions -r debian/control) +export PYVERSIONS + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f $(CURDIR)/*pyo + rm -f $(CURDIR)/*pyc + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs -v + + # Add here commands to install the package into debian/python-xmpp + set -e; \ + for v in $(PYVERSIONS); do \ + mkdir -p debian/python-xmpp/usr/lib/$$v/site-packages/xmpp; \ + export MODULESDIR=$(CURDIR)/debian/python-xmpp/usr/lib/$$v/site-packages/ ; make install; \ + done + + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir -i + dh_testroot -i + + [ -d examples ] || mkdir examples + cp -r doc/examples/* examples + [ -d html ] || mkdir html + cp -r doc/*html doc/apidocs html + + dh_installdocs -i + dh_installexamples -i + dh_installchangelogs -i ChangeLog + dh_link -i + dh_compress -i -X.py + dh_fixperms -i + dh_python2 -i + dh_installdeb -i + dh_shlibdeps -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + + rm -rf html examples + +# Build architecture-dependent files here. +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- python-xmpp-0.4.1.orig/doc/basic.html +++ python-xmpp-0.4.1/doc/basic.html @@ -6,14 +6,6 @@ Xmpppy usage - basics. -

Preface.

English is not my native language. If you see any bugs in this text, please, let me know.

Basic

--- python-xmpp-0.4.1.orig/xmpp/auth.py +++ python-xmpp-0.4.1/xmpp/auth.py @@ -12,7 +12,7 @@ ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. -# $Id: auth.py,v 1.38 2007/08/28 10:03:33 normanr Exp $ +# $Id: auth.py,v 1.39 2008/02/08 09:00:55 normanr Exp $ """ Provides library with all Non-SASL and SASL authentication mechanisms. @@ -173,11 +173,11 @@ chal={} data=base64.decodestring(incoming_data) self.DEBUG('Got challenge:'+data,'ok') - for pair in re.findall('(\w+=(?:"[^"]+")|(?:[^,]+))',data): - key,value=pair.split('=', 1) + for pair in re.findall('(\w+\s*=\s*(?:(?:"[^"]+")|(?:[^,]+)))',data): + key,value=[x.strip() for x in pair.split('=', 1)] if value[:1]=='"' and value[-1:]=='"': value=value[1:-1] chal[key]=value - if chal.has_key('qop') and 'auth' in chal['qop'].split(','): + if chal.has_key('qop') and 'auth' in [x.strip() for x in chal['qop'].split(',')]: resp={} resp['username']=self.username resp['realm']=self._owner.Server --- python-xmpp-0.4.1.orig/xmpp/jep0106.py +++ python-xmpp-0.4.1/xmpp/jep0106.py @@ -29,8 +29,29 @@ for each in xep0106mapping: str = str.replace(each[0], '\\' + each[1]) return str - + def JIDDecode(str): for each in xep0106mapping: str = str.replace('\\' + each[1], each[0]) return str.replace('\\5c', '\\') + +if __name__ == "__main__": + def test(before,valid): + during = JIDEncode(before) + after = JIDDecode(during) + if during == valid and after == before: + print 'PASS Before: ' + before + print 'PASS During: ' + during + else: + print 'FAIL Before: ' + before + print 'FAIL During: ' + during + print 'FAIL After : ' + after + print + + test('jid escaping',r'jid\20escaping') + test(r'\3and\2is\5@example.com',r'\5c3and\2is\5\40example.com') + test(r'\3catsand\2catsis\5cats@example.com',r'\5c3catsand\2catsis\5c5cats\40example.com') + test(r'\2plus\2is\4',r'\2plus\2is\4') + test(r'foo\bar',r'foo\bar') + test(r'foob\41r',r'foob\41r') + test('here\'s_a wild_&_/cr%zy/_address@example.com',r'here\27s_a\20wild_\26_\2fcr%zy\2f_address\40example.com') --- python-xmpp-0.4.1.orig/xmpp/transports.py +++ python-xmpp-0.4.1/xmpp/transports.py @@ -12,7 +12,7 @@ ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. -# $Id: transports.py,v 1.31 2007/09/15 11:34:28 normanr Exp $ +# $Id: transports.py,v 1.32 2008/01/04 11:32:53 normanr Exp $ """ This module contains the low-level implementations of xmpppy connect methods or @@ -181,7 +181,8 @@ # Avoid printing messages that are empty keepalive packets. if raw_data.strip(): self.DEBUG(raw_data,'sent') - self._owner.Dispatcher.Event('', DATA_SENT, raw_data) + if hasattr(self._owner, 'Dispatcher'): # HTTPPROXYsocket will send data before we have a Dispatcher + self._owner.Dispatcher.Event('', DATA_SENT, raw_data) except: self.DEBUG("Socket error while sending data",'error') self._owner.disconnected()