--- jabber.py-0.5.0.orig/debian/README.Debian +++ jabber.py-0.5.0/debian/README.Debian @@ -0,0 +1,33 @@ +jabber.py for Debian +------------------------ + +A patch has been applied: + - Typo fixing patch, from David in jabber-devel ML. + on 20/06/2003 + + +Not yet used patches: + +Some patches had been applied to fix some problem in the old jabber.py +version (prior to 0.4.0): + - SSL patch, according to Ross Karchner notes in jabberpy-devel ML. + on 05/29/2002 + - xmlstream.Stream._parser stacking problem, kludged by me + - jabber.Iq.setQueryNode fix: 2nd arg have to exist + on 05/16/2002 by Erik Westra + - jabber.Client.auth() as Erik Westra advised in jabberpy-devel ML + on 05/16/2002 + +Any patch applied can be found in /usr/share/doc/pythonX.Y-jabber/patches/ + +Since upstream maintainer is quite slow, I've to patch myself bugged +code. If something that yesterday worked now does not work anymore: +- see Changelog.Debian and reverse patch I've applied, rebuild package + yourself so that you can have working modules. +- try to undestand what is not working and why +- write a small program that show the behaviour with and without the + patch +- file a bug against python-jabber on BTS (see reportbug or bug + packages) + + -- Cosimo Alfarano , Thu, 30 May 2002 11:49:26 +0200 --- jabber.py-0.5.0.orig/debian/changelog +++ jabber.py-0.5.0/debian/changelog @@ -0,0 +1,192 @@ +jabber.py (0.5.0-1.6) unstable; urgency=low + + * Non-maintainer upload. + * Replaced python-support with dh-python (Closes: #786036) + + -- Ana Rodriguez Lopez Wed, 19 Aug 2015 19:08:14 +0200 + +jabber.py (0.5.0-1.5) unstable; urgency=medium + + * Non-maintainer upload. + * Respect uudecode arguments order. (Closes: #730881) + + -- David Prévot Mon, 23 Dec 2013 14:47:51 -0400 + +jabber.py (0.5.0-1.4) unstable; urgency=low + + * Non-maintainer upload. Thanks to Franz Pletz Sat, 14 Oct 2006 23:17:49 +0200 + +jabber.py (0.5.0-1.3) unstable; urgency=low + + * Non-maintainer upload. + * ./examples/pypguijab.py: Fix shebang line to not use python2.2; + this will drop the python2.2 dependency. (Closes: #377813) + + -- Martin Pitt Wed, 12 Jul 2006 10:32:10 +0200 + +jabber.py (0.5.0-1.2) unstable; urgency=low + + * Non-maintainer upload. + * Update package to the last python policy (Closes: #373446). + + -- Pierre Habouzit Fri, 30 Jun 2006 15:37:19 +0200 + +jabber.py (0.5.0-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Removed python2.{1,2}-jabber (Closes: #351123) + * Updated Debian policy version to 3.6.2 (no changes required) + * Added python2.4-jabber + + -- Torsten Marek Sat, 22 Apr 2006 16:17:00 +0200 + +jabber.py (0.5.0-1) unstable; urgency=low + + * New upstream release. + * v0.5 fixes the ustr() bug catching AttributError exception. + closes: #235680 + + -- Cosimo Alfarano Sat, 6 Mar 2004 16:43:21 +0100 + +jabber.py (0.4.0-6) unstable; urgency=low + + * Apply patch from Alexey Nezhdanov fixing a backtrace due to access to a + None object + closes: Bug#213697 + + -- Cosimo Alfarano Fri, 3 Oct 2003 15:32:31 +0200 + +jabber.py (0.4.0-5) unstable; urgency=low + + * Updated python 2.3 as default debian python version + + -- Cosimo Alfarano Tue, 12 Aug 2003 15:20:15 +0200 + +jabber.py (0.4.0-4) unstable; urgency=low + + * added patch by Alexey Nezhdanov fixing unicode bug in xmlstream.py + closes: Bug#166187 + + -- Cosimo Alfarano Sat, 26 Jul 2003 19:48:30 +0200 + +jabber.py (0.4.0-3) unstable; urgency=low + + * applied patch from David JL got from jabberpy-devel@lists.sourceforge.net + fixing some typos in jabber.py + closes: Bug#198290 + + -- Cosimo Alfarano Tue, 1 Jul 2003 17:15:04 +0200 + +jabber.py (0.4.0-2) unstable; urgency=low + + * updated Section to python + (http://lists.debian.org/debian-devel-announce/2003/debian-devel-announce-200303/msg00028.html) + + -- Cosimo Alfarano Mon, 31 Mar 2003 21:38:46 +0200 + +jabber.py (0.4.0-1) unstable; urgency=low + + * fixed some doc links (closes: Bug#185879) + + -- Cosimo Alfarano Sun, 23 Mar 2003 15:41:32 +0100 + +jabber.py (0.4.0-0) unstable; urgency=low + + * New Upstream Version released + * improved description in debian/control (closes: Bug#176810) + * addedd suggestion of pythonX.Y-xml and removed dependancies from + python2.3-xmlbase + + -- Cosimo Alfarano Sat, 1 Mar 2003 19:00:56 +0100 + +jabber.py (0.3.1-7.3) unstable; urgency=low + + * added python2.3 packages + * added patches/unused/ directory in /usr/share/doc/python*-jabber + + -- Cosimo Alfarano Tue, 24 Dec 2002 23:31:25 +0100 + +jabber.py (0.3.1-7.2) unstable; urgency=low + + * the Christmas Release + * applied patch from Mrinal Kalakrishnan for correct + joining of XMLunescape() arg in Node.getData() (closes: Bug#174186) + stored in patches/22xmlstream.py_getData.patch + + -- Cosimo Alfarano Tue, 24 Dec 2002 21:07:33 +0100 + +jabber.py (0.3.1-7.1) unstable; urgency=low + + * fixed debian/control, python-jabber has to depend on python2.2-jabber + (closes: Bug#161293) + * description improvement (closes: Bug#149866) + + -- Cosimo Alfarano Wed, 18 Sep 2002 12:39:56 +0200 + +jabber.py (0.3.1-7) unstable; urgency=low + + * modified debian/control to respect python2.2 as python default version + + -- Cosimo Alfarano Thu, 29 Aug 2002 21:10:49 +0200 + +jabber.py (0.3.1-6) unstable; urgency=low + + * patched jabber.Client.auth as Erik Westra adviced in jabberpy-devel + * reversed the escaping order of xmlstream.XMLunescape() respect of + xmlstream.XMLescape() (closes: Bug#149270) + It should close the bug (feel free to reopen in case...), + waiting for upstream approval. + + -- Cosimo Alfarano Sun, 9 Jun 2002 12:36:25 +0200 + +jabber.py (0.3.1-5) unstable; urgency=low + + * fixed typo in debian/control + * jabber.Roster.Iq.setQueryNode fix + * dependancies to python*-xmlbase fixed in a previous notupladed version + (closes: Bug#149269) + * changed DIRLIST value to /usr/lib/python$PV/site-packages/ instead of + /usr/lib/python$PV/site-packages/extension + + -- Cosimo Alfarano Sat, 8 Jun 2002 12:05:27 +0200 + +jabber.py (0.3.1-4) unstable; urgency=low + + * added dependancies pythonX.Y-xmlbase + * patched xmlstream.py to let a jabber.Message can be sent during + messageHandler callback processing (my own patch) + * removed docs/test_client.py, in examples/ there is a newer version + + -- Cosimo Alfarano Wed, 5 Jun 2002 16:34:59 +0200 + +jabber.py (0.3.1-3) unstable; urgency=low + + * patching xmlstream.py to let SSL work + according to Ross Karchner correction sent in + jabberpy-devel ML (2002-05-30 22:21): + - _SSLsock -> _SSLobj + - recv() -> read() + - process() uses _sock + Tested: seems to work. + + -- Cosimo Alfarano Sat, 1 Jun 2002 15:45:16 +0200 + +jabber.py (0.3.1-2) unstable; urgency=low + + * First Upload + * closing ITP (closes:#148541) + + -- Cosimo Alfarano Fri, 31 May 2002 20:53:18 +0200 + +jabber.py (0.3.1-1) unstable; urgency=low + + * Initial Release, + + -- Cosimo Alfarano Thu, 30 May 2002 11:49:26 +0200 --- jabber.py-0.5.0.orig/debian/compat +++ jabber.py-0.5.0/debian/compat @@ -0,0 +1 @@ +5 --- jabber.py-0.5.0.orig/debian/control +++ jabber.py-0.5.0/debian/control @@ -0,0 +1,19 @@ +Source: jabber.py +Section: python +Priority: optional +Maintainer: Cosimo Alfarano +Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.3.5-11) +Build-Depends-Indep: dh-python, sharutils +Standards-Version: 3.7.2 +XS-Python-Version: all + +Package: python-jabber +Architecture: all +Depends: ${python:Depends} +Provides: ${python:Provides} +Replaces: python2.3-jabber (<< 0.5.0-1.2), python2.4-jabber (<< 0.5.0-1.2) +Conflicts: python2.3-jabber (<< 0.5.0-1.2), python2.4-jabber (<< 0.5.0-1.2) +XB-Python-Version: ${python:Versions} +Suggests: python2.3-xml +Description: Python module for the Jabber instant messaging platform + Jabber.py is a set of python modules to handle jabber XML-based protocol. --- jabber.py-0.5.0.orig/debian/copyright +++ jabber.py-0.5.0/debian/copyright @@ -0,0 +1,8 @@ +This package was debianized by Cosimo Alfarano on +Thu, 30 May 2002 11:49:26 +0200. + +It was downloaded from http://sourceforge.net/projects/jabberpy/ + +Upstream Author: Matthew Allum + +Copyright: See /usr/share/common-licenses/LGPL --- jabber.py-0.5.0.orig/debian/img/jabber-powered-20.png.b64 +++ jabber.py-0.5.0/debian/img/jabber-powered-20.png.b64 @@ -0,0 +1,54 @@ +begin-base64 644 jabber-powered-20.png +iVBORw0KGgoAAAANSUhEUgAAAIgAAAAUCAMAAABhwIVYAAADAFBMVEX///8y +MjLGxsZjY2PlfHx1dXXe3t7dVFT65OTuqqrkenrQFRX319cmJib20dGzs7P8 +/Pz6+vraR0fKysr19fX0ycnql5fExMTZQkKqqqrtpqbcUFDojo7q6ur54uLo +iork5OTb29sAAADkd3fPz88GBgbws7PfYWFHR0fAwMBlZWXuqKg1NTW6urre +XFzmgYHsnp5/f3/rmprMAgLZQECIiIjxu7vWMTFmZmbbSkrnhoYqKirmhITc +3Nw5OTncTk4RERFpaWnsoKDjdHSRkZHibm7SICA+Pj6Kior76+vhaGjNBATW +NDTgZmZtbW29vb2EhIQNDQ1CQkK4uLjto6OAgIDVLCzSHR1aWlrOCgqwsLD0 +xsbUJyfjcnKlpaVTU1OioqLaSEgsLCzPDw/UKireWFjpk5PTIiKGhoYdHR3V +Ly97e3vcUlJUVFTibGxycnJMTEzRGhpra2vPERHdV1cXFxdXV1fRGBg8PDwZ +GRnYOzsuLi4JCQlPT0/WMjJKSkrUKCjMAADT09Pxt7f88PDaRET//f34+Pj+ ++vrV1dX87u7rnZ3MAQH21NT20tLpkZHNBwfaRUXrnJz+/PzU1NT209P++/vy +vb399vbxuLj77e3pkJDhamrZPz/S0tLha2vrmZn54OBRUVHwtrb65+f54eHX +ODj1z89ISEj65ubYPT3zwsLX19f31dW0tLTy8vLx8fHqlZWYmJjgZWX66Oj4 +3d0iIiL43t70ysrvsLD98/P99PTt7e387+/vsbFhYWHqmJjQExP1zs7xubnz +w8PXNzf99/fg4ODPDQ3mg4P88vL77OzjcXH99fXh4eHv7++WlpZfX1/R0dH4 +2trY2Nj88fHTJSXzxMTgY2P32dn1y8v539+Dg4O1tbXlf3+SkpL1u7v0tLS/ +v7/ojIzkeHjSHx/wlZX0t7d8fHzniYmUlJTCwsLw8PDujY3s7OzzwcHzrKy2 +trbMzMz3y8vn5+dERESfn5/87e31zc3p6emampryt7fi4uLyv7+srKz++Pj2 +YXlDAAAAAXRSTlMAQObYZgAAAAFiS0dE/6UH8sUAAAAWdEVYdFNvZnR3YXJl +AGdpZjJwbmcgMi40LjBNUCYiAAAFh0lEQVR42sWWd1xTVxTHTzAQkCkIjURB +Hz5AK0NFIWAtiIASHLEaRKlYolKwVqniAtueMASZAooKihbUuvfee+89u/fe +u/Tc+17Cx5b2D/uH94/zfnd/c8859waASsGS7fNAKnOLTKZOYCk/vqJwbMvV +n4P9Z1lDi6VtZ9PmtvC/SrmSTKGHq/2qbT6lvKVaL4qKuZYBwwRBtOGqlSAI +U1pe5ftDr6U4w3eurmp1frzdY4GojACN+YOO3dp+41jgHtayTBSEiGYQ2l68 +ytUIAvFveZX9I6L0o+AdRJ0OEVWLHgMkMBFu1A8nsabfwZWGr0iYCCT1UZD1 +XHUnkDf/ZRmT25Bf4CNU5+V5lRtR+Xgg7aV5Z8O9fbWFMkgbgA5WzlabOEhO +l3e/6SSB+LttNEkTOwZstGJfl83XoWhMZyZ/Q1f2qcXMfQBVBf+98cJ/gqhH +y7rP0dtvyyCbAkZG0r7pA6ArfUjmWHPX6EVBnHIR4MuurHtYEWycmZU1WS9k +7af5uTifLbNBV+LlPt4QOsipMCaak9UyW1wMR/1OLPUE2F23Z5d2POSqEgLd +Wc+ubZq61X6JoDGz2/7h+YUE0q2XIJfLg83qOUtbdsfP+0oq3TRKEinQDHJU +Z7RLTFY9e8S4ZarOFsALkdLggC6++PRNlTapftFwTAjNPP9+zxPjb1aUF0CD +ISNQFRKbDLNXyCBNAxd/KIEoft8pRo39mKVJGJm+U8g4MqQcf+oVrNuRibKa +KQhxphyKoUnTAyQQLdmqaTg7U0Mn35iW5ofFAFsQwwH2nI7GkCaAGKxcocM+ +TT74PMDeULzVWDGOAuJcchp4vmdx1MOvZdeA1XWAz2i7N8g1YjUoyD9xzBmQ +QjZuMjV2hk+p0VkvCJPk2bk4bnmldwjOCMJKVlf2VGI8gEYzVQ3Q2j4fyS3Q +gH47SkKhKrHkDtXO4GEP5P5TxwL4HpBX8lr7kwQSAXD5h3S9GWQ9D9mdPGuG +ks0axk4oO50a36JYCbOA8LL25+XI7xJPbH/EAHvtg7VJ8yDE8DrGLD/cIwa1 +Gyiod+h0n1DtJXxYhx5s8NJYdq9KC+WpiuX0VZyaKccDByliISvO4vfIfRay +3czhIvQikFYWkNDchtxrBaCUQBZjD03JmuMlq73x2MIkjUHirFBtwHworeAV +XUWdhrlPBpE58vkZ8WC9Isi+kE/kEO2eajmRdNbjmJqarVBsfQTkBUmcMYM8 +PQEPeuO53Ri0Gn1WYQ+HsrIFZbalBOLQM2l0KdUW2Lpi8N9APDRgBnFkbuhy +ilRKFIuRNnQEWZPYibiwGJlDcSvSLTLXho9uBpkvCU8pRvphjRPGq9Oqmuxd +w7FGi75SdxmB7DXq5BzZhuU8Rj7gtR39ystrnSwgEdm03RX2uDj6k1EwV0QN +tTglwJk1Tuzun/Vrp5ZA5sWuvQCw5NUZZyHBWEIpE63LDC2ww4xr1Nk7z4FA +wAc1AwFO1hSs47OOz0jmU++537XzuMtlEXNNd0sQRMpffQfLPdIKNkeYex9Q ++h6SQRpQLStfTKitzcCXAYIQFwCsQ2wN4IdT6ydo0G4lG5eXgMnK8AzqrUdX +pQoxjc90rwzeErOLy28JJO7SSLZNXI4wcboopoosPcBaFCMJQAyjh+iZOew+ +EeOGmCJF0Zw1vY0as5tb0+OXFL+EEIyr6EpZZDD2pkdeeQTRPujAHT7O9nYS +oiH4JBT66LAi+nymNPOg9zT5+WY/nJa26n//AThvBZtl1ZueGtC/GkiZbC5t +HeAmDbs69sX+bi7s38uyjubnI2+fJeBWLq5ZI6UAf4ov5Ek+c3Knvz1V8rjG +3Q6FXGwvJWT5/1DTPSl2XLowX4yBJ146sNtCsf/Jg0C7CMewi09k578AWCzn +P0E9Fa0AAAAASUVORK5CYII= +==== --- jabber.py-0.5.0.orig/debian/img/logo-56-80.png.b64 +++ jabber.py-0.5.0/debian/img/logo-56-80.png.b64 @@ -0,0 +1,62 @@ +begin-base64 600 logo-56-80.png +iVBORw0KGgoAAAANSUhEUgAAADgAAABQCAIAAADDQyF+AAAABmJLR0QAAAAA +AAD5Q7t/AAAACXBIWXMAAC4iAAAuIgGq4t2SAAAAB3RJTUUH0gEQFRUfXgvj +0QAACf5JREFUeAG1m2WoVU0Xx73H7nztDuxAsQtbREURsRVRPygiKioogiAG +iA0iioWJgiIoYoKtYGA3dnd3vL/z7Mu4nFl7n73Pvfd8uKxZs+K/J9asiZvy +58+fTEn9Xr16debMmYsXL964ceP+/ftPnz598+bNp0+ffv/+jb3MmTPnzp27 +UKFCxYsXL1u2bNWqVevUqVO/fv0CBQok5S1TJoCG/wHixIkTEydOxCtQorrM +kiULWKdMmXL69GlMhfeLZFigb9++nTt3bpUqVaKC85OvXbv2kiVLPn78GBJu +YqCfP3+eNWtWwYIF/VymhV+0aNEFCxZ8+/YtIdwEQA8cOFCpUqW0QAmjW6NG +jePHjwdj9QX68+fPyZMnx2KxMJ7SLsPwnTlz5q9fv/zg6kAZOt26dUu7+6gW ++vXr9/XrVxWrAhSUrVu3juojveS7dOmiYrWB/vjxA9EkvKakpOTNm7dEiRLl +y5cvV64cRJ48eZKwg0rfvn3dMWADHT9+fEjrOXLkaNeu3bRp07Zv33716lX6 +wbJO8cOHD5cvX966devUqVPppWzZsoU0Pn36dGsA/AN0586dNEywLQRwuX79 ++vfv31u2EhZZulavXt20adNgF9Symhw+fFga/AuUkF6qVKlgE0A8efKk1E+O +PnjwYOPGjYN9sbgQwo39v0AnTJgQoMnCvXz58qjrnnHjEgwMQn327NkDnM6Y +McMopgJ9+PAhY85Pp2TJkmfPnjU66UgcO3asSJEifn7z589P6uO5SwUaMIdI +f8iP0hGcZercuXMB67OZVXGgTFi/7It5mnBxsxwnUdy7d69fLkZnfv/+HZtx +oGvXrvVrfDlKkkAQXiVghuzYsSMVaNeuXVWglStXDpPXhEcTIEnEpfFUGAMH +DowDJSfPlSuXKrFq1aoA0+leNX/+fBUGs431MhOJnFrNAJdhLN1huQZZDnLm +zKmCYc8TY2uh1nXv3t1PTZVPO5MJ3bFjR9UOIGNEB7Wuffv2Kj9DmX5Oz58/ +HyNGqr4bNGig8jOUydZPtX/9+vXYgwcP3DoS+zJlyrj8jOaQIqouABkjF3Hr +CL/sDVx+RnP88sDXr1/H1LyOjIFfRsNy7cfDkPajh2NqECVLYl3VVDKWR9hX +HZC7xYoVK6bWPX/+XOVnKPPly5eqfWJ+rGLFimodx0kqPyGT7vPrwYS6ZJuq +TIUKFWL16tVT665du6byEzJ79+49YsSIhGKqwK1bt1R+rVq1Yq1atVLryJRV +fkIm44ntaEIxVeDChQsqv3nz5rE2bdqodo8cOcJyrKoFM0mC/PKgYEXcsSFz +ZYDXsmXLGA1AZ7nVxFi/73OFJed///0kJyR98+bNe/fuucI9evQgNMWPltiH +qAn2pk2bXLWEHNIufgnFXIFt27a5TML86NGj43wv3Ro6dKgrxG7py5cvbj4W +zNm4ceOePXuCZdxaIjdnei4GknpPOBUoURNYrtzSpUtdowEcPqxXr158trfR +CZC0qvg21zt5JumIJ5kKlMLu3bvdAcC0iHQiMnjwYM/fmDFjLCgBRZqzRYsW +LtCFCxcarb9AYc2bN8+VZgQb6WCCXZhRZ3H24kawilfL4ZRRNESfPn3kecc/ +QFGbNGmSEfUImvno0aMJ/bEaWYOsSZMm0pOfBXqMaxPLKedTbOakig0U0+PG +jbPUWGbZ0Eg1l96yZYulRZENuytpcUaNGmUpsg6x6FtiNlCv2sVKrLU0raI6 +yMyctYRNcd++fQwSCZQ9+uPHj42AIXSgarsuW7bMqFkEc1PNa8m+Va+eutvp +pUuXvnPnjmXcK+pAqQPr8OHD5beyhrF4qFZmz54tJSUdEOCIDFKSpZJNnGof +pi9Q6oiFbdu2lbY6deqkGoIvxSTN5FVVrly5kjVrViNJhzDKVUmPGQQUCTqO ++0xjDmL//v2uOYa/lJE0+YQrD4eDGinWv39/VcwwEwBFjqgrLarzg7xBykia +Vco4MwSnnvIIF5o83dSqRGKgxDOZZNBf7AktW5s3b5bgJM28toQpcgUgZbhe +cmUsTmKgKJiF0bPunQNKQ1zz1axZU/r2aBJeNeaPHDlSCvOd0ppK/xPDpLKk +rXsMbmRkLTSrlzvxmR8w1bBFOJMWGjVqJIsqHQqodYDx7Nkz1xZj15pSNCcz +yZWEI7e4fGTC2xhUQgG17uA4jnTd03JglfyA21QuEY0klxxu1mZqDREKqHXC +/+7dO6MvCSujLVy4sKyVNJmDKcYPF/5dRU2VJEIBpWukLfVcDaP58uWTpmX/ +Sj6RiLhhOG7qZKokEQoo4YlLWKPGzSdz2RQNQT5haAiuU2TR0OvWrWNem2KY +mRQXVmOBy7RCOscTrgzHVfIki4zEvUaDY414dalzjYcFunjxYtMGEIsWLXJt +wRkwYIAUox/YWzJ16AEGzJw5c6zh0bBhQ44NVVMWMyzQu3fvyohIZLUMeUUC +pHvyz2LG1Jbq3sfQ/BzMq3ZcZligaMpMCq+nTp1yzcHZsGFDmHDDANi1a5dq +QWVGACr3bjQJNxjq8ogbEJACyzFg0ZwjkeapgPyYEYACi8VGuly5cqWfXRaF +FStW8OqD81camB6go3l/RrLMXYyfVgA/AlCscBol0zNGnpocSX98HqAJCGxT +JT8qHQ0o1tlayEYFKy/XQs7cqOCkfGSgKPPgRWKF5n6Ii1MePErT6UunYM7y +GqbIjnTs2LEyt0CLgchyz6kjzewZYXRyI8PoJFugihNuDrhZiuT4CeMuLpP0 +d5OV+l1dBvsGNOcG3G9Fcp08UM8N0ZSjDl5kBYNza2laJll4rEl2veuY/SrJ +ypMnT7gr8m5FmGEQPE1gytN+JFO3b99GxqvFAvFr2LBhrimVk0XlJsH87+Re +f8Igrb148aJDhw4cNMAk5suqYDpUmhdsIlIt08uktpHuJJLveobXo0ePSFY4 +eWNLTRfTp4R3g5utKT8iA7Wm6y9duoQkMgQHlg9rU2B0FSL8cDaSbEV4VBOp +PSzHzZo1A7ExGIaI3KIYJaU4dOiQ5dsrWpfn9DIcwipvwkwcJajVrVtXVQ9g +RgbKiwke1WNx0KBBPPTk/QEbFXJQYjiwrAQPjssMQBNQFXnWc6jpmevZs2dy +T2ID0ARURW5RLmiqVavGTpIFkw0kLcpKwyJJi9LLMKUzr5n5iwC9zwRiaeDw +B0KKhaLDDGRLhsnOC1ue47Lt5FCSIchmgx/97v7oegsHH8MYJYkhRFiWA4qR +W9Ty6hUJTPhgKbJqgcKPIEVIYsEkXJBh8dqKJ39w1qxZM2TIEEvFrxh5jKqG +aE6V7zL5HrqePS1LFAftroAfJ31a1FjnrIYXn95BiNfMNCcE7UfY91oUiMCt +Xr0614rhHy2lM1D+a4h30PJoiW9gkjGf2HZyGsWmjxYlEnfu3Dl8P2Dk/2Gp +ouqEcyRWAAAAAElFTkSuQmCC +==== --- jabber.py-0.5.0.orig/debian/jabber.html +++ jabber.py-0.5.0/debian/jabber.html @@ -0,0 +1,1546 @@ + + +Python: module jabber + + + + +
 
+ 
jabber
index
/home/kalfa/debian/mypackages/jabber.py/jabber.py-0.5.0/jabber/jabber.py
+

__intro__

+jabber.py is a Python module for the jabber instant messaging protocol.
+jabber.py deals with the xml parsing and socket code, leaving the programmer
+to concentrate on developing quality jabber based applications with Python.

+The eventual aim is to produce a fully featured easy to use library for
+creating both jabber clients and servers.

+jabber.py requires at least python 2.0 and the XML expat parser module
+( included in the standard Python distrubution ).

+It is developed on Linux but should run happily on over Unix's and win32.

+__Usage__

+jabber.py basically subclasses the xmlstream classs and provides the
+processing of jabber protocol elements into object instances as well
+'helper' functions for parts of the protocol such as authentication
+and roster management.

+An example of usage for a simple client would be ( only psuedo code !)

+<> Read documentation on jabber.org for the jabber protocol.

+<> Birth a jabber.Client object with your jabber servers host

+<> Define callback functions for the protocol elements you want to use
+   and optionally a disconnection.

+<> Authenticate with the server via auth method, or register via the
+   reg methods to get an account.

+<> Call requestRoster() and sendPresence()

+<> loop over process(). Send Iqs,messages and presences by birthing
+   them via there respective clients , manipulating them and using
+   the Client's send() method.

+<> Respond to incoming elements passed to your callback functions.

+<> Find bugs :)

+

+ + + + + +
 
+Modules
       
debug
+
sha
+
time
+
xmlstream
+

+ + + + + +
 
+Classes
       
+
xmlstream.Client(xmlstream.Stream) +
+
+
Connection +
+
+
Client +
Component +
+
+
+
+
exceptions.Exception +
+
+
NodeProcessed +
+
+
JID +
xmlstream.Node +
+
+
Protocol +
+
+
Iq +
Log +
Message +
Presence +
XDB +
+
+
+
+
Roster +
Server +
+

+ + + + + + + +
 
+class Client(Connection)
   Class for managing a client connection to a jabber server.
 
 
Method resolution order:
+
Client
+
Connection
+
xmlstream.Client
+
xmlstream.Stream
+
xmlstream.NodeBuilder
+
+
+Methods defined here:
+
__init__(self, host, port=5222, debug=[], log=0, connection=1, hostIP=None, proxy=None)
+ +
addRosterItem(self, jid)
Send off a request to subscribe to the given jid.
+ +
auth(self, username, passwd, resource)
Authenticates and logs in to the specified jabber server
+Automatically selects the 'best' authentication method
+provided by the server.
+Supports plain text, digest and zero-k authentication.

+Returns True if the login was successful, False otherwise.
+ +
deregister(self, agent=None)
Send off a request to deregister with the server or with the given
+agent.  Returns True if successful, else False.

+Note that you must be authorised before attempting to deregister.
+ +
disconnect(self)
Safely disconnects from the connected server
+ +
discoverInfo(self, jid, node=None)
According to JEP-0030:
+For identity: category, name is mandatory, type is optional.
+For feature: var is mandatory
+ +
discoverItems(self, jid, node=None)
According to JEP-0030: jid is mandatory, name, node, action is optional.
+ +
getRegInfo(self)
Returns a dictionary of fields requested by the server for a
+registration attempt.  Each dictionary entry maps from the name of
+the field to the field's current value (either as returned by the
+server or set programmatically by calling setRegInfo().
+ +
getRoster(self)
Returns the current Roster() class instance. Does
+not contact the server.
+ +
removeRosterItem(self, jid)
Removes an item with Jabber ID jid from both the
+server's roster and the local internal Roster()
+instance
+ +
requestAgents(self)
Requests a list of available agents.  Returns a dictionary
+containing information about each agent; each entry in the
+dictionary maps the agent's JID to a dictionary of attributes
+describing what that agent can do (as returned by the
+NS_AGENTS query).
+ +
requestRegInfo(self, agent='')
Requests registration info from the server.
+Returns the Iq object received from the server.
+ +
requestRoster(self)
Requests the roster from the server and returns a
+Roster() class instance.
+ +
sendInitPresence = sendPresence(self, type=None, priority=None, show=None, status=None)
+ +
sendPresence(self, type=None, priority=None, show=None, status=None)
Sends a presence protocol element to the server.
+Used to inform the server that you are online
+ +
sendRegInfo(self, agent=None)
Sends the populated registration dictionary back to the server
+ +
setRegInfo(self, key, val)
Sets a name/value attribute. Note: requestRegInfo must be
+called before setting.
+ +
updateRosterItem(self, jid, name=None, groups=None)
Update the information stored in the roster about a roster item.

+'jid' is the Jabber ID of the roster entry; 'name' is the value to
+set the entry's name to, and 'groups' is a list of groups to which
+this roster entry can belong.  If either 'name' or 'groups' is not
+specified, that value is not updated in the roster.
+ +
+Methods inherited from Connection:
+
SendAndWaitForResponse(self, obj, ID=None, timeout=300)
Sends a protocol element object and blocks until a response with
+the same ID is received.  The received protocol object is returned
+as the function result.
+ +
dispatch(self, stanza)
Called internally when a 'protocol element' is received.
+Builds the relevant jabber.py object and dispatches it
+to a relevant function or callback.
+ +
getAnID(self)
Returns a unique ID
+ +
header(self)
+ +
registerHandler(self, name, handler, type='', ns='', chained=0, makefirst=0, system=0)
Sets the callback func for processing incoming stanzas.
+Multiple callback functions can be set which are called in
+succession. Callback can optionally raise an NodeProcessed error to
+stop stanza from further processing. A type and namespace attributes can
+also be optionally passed so the callback is only called when a stanza of
+this type is received. Namespace attribute MUST be omitted if you
+registering an Iq processing handler.

+If 'chainOutput' is set to False (the default), the given function
+should be defined as follows:

+     def myCallback(c, p)

+Where the first parameter is the Client object, and the second
+parameter is the [ancestor of] Protocol object representing the stanza
+which was received.

+If 'chainOutput' is set to True, the output from the various
+handler functions will be chained together.  In this case,
+the given callback function should be defined like this:

+     def myCallback(c, p, output)

+Where 'output' is the value returned by the previous
+callback function.  For the first callback routine, 'output' will be
+set to an empty string.

+'makefirst' argument gives you control over handler prioriy in its type
+and namespace scope. Note that handlers for particular type or namespace always
+have lower priority that common handlers.
+ +
registerProtocol(self, tag_name, Proto)
Registers a protocol in protocol processing chain. You MUST register
+a protocol before you register any handler function for it.
+First parameter, that passed to this function is the tag name that
+belongs to all protocol elements. F.e.: message, presence, iq, xdb, ...
+Second parameter is the [ancestor of] Protocol class, which instance will
+built from the received node with call

+     if received_packet.getName()==tag_name:
+         stanza = Proto(node = received_packet)
+ +
send(self, what)
Sends a jabber protocol element (Node) to the server
+ +
setDisconnectHandler(self, func)
Set the callback for a disconnect.
+The given function will be called with a single parameter (the
+connection object) when the connection is broken unexpectedly (eg,
+in response to sending badly formed XML).  self.lastErr and
+self.lastErrCode will be set to the error which caused the
+disconnection, if any.
+ +
setIqHandler(self, func, type='', ns='')
Back compartibility method
+ +
setMessageHandler(self, func, type='', chainOutput=0)
Back compartibility method
+ +
setPresenceHandler(self, func, type='', chainOutput=0)
Back compartibility method
+ +
waitForResponse(self, ID, timeout=300)
Blocks untils a protocol element with the given id is received.
+If an error is received, waitForResponse returns None and
+self.lastErr and self.lastErrCode is set to the received error.  If
+the operation times out (which only happens if a timeout value is
+given), waitForResponse will return None and self.lastErr will be
+set to "Timeout".
+Changed default from timeout=0 to timeout=300 to avoid hangs in
+scripts and such.
+If you _really_ want no timeout, just set it to 0
+ +
+Methods inherited from xmlstream.Client:
+
connect(self)
Attempt to connect to specified host
+ +
getSocket(self)
+ +
+Methods inherited from xmlstream.Stream:
+
disconnectHandler(self, conn)
Called when a Network Error or disconnection occurs.
+Designed to be overidden
+ +
disconnected(self, conn)
Called when a Network Error or disconnection occurs.
+ +
getIncomingID(self)
Returns the streams ID
+ +
getOutgoingID(self)
Returns the streams ID
+ +
log(self, data, inout='')
Logs data to the specified filehandle. Data is time stamped
+and prefixed with inout
+ +
process(self, timeout=0)
Receives incoming data (if any) and processes it.
+Waits for data no more than timeout seconds.
+ +
read(self)
Reads incoming data. Blocks until done. Calls disconnected(self) if appropriate.
+ +
timestampLog(self, timestamp)
Enable or disable the showing of a timestamp in the log.
+By default, timestamping is enabled.
+ +
write(self, raw_data)
Writes raw outgoing data. Blocks until done.
+If supplied data is not unicode string, ENCODING
+is used for convertion. Avoid this!
+Always send your data as a unicode string.
+ +
+Methods inherited from xmlstream.NodeBuilder:
+
DEBUG(self, dup1, dup2=None)
+ +
getDom(self)
+ +
handle_data(self, data)
XML Parser callback
+ +
unknown_endtag(self, tag)
XML Parser callback
+ +
unknown_starttag(self, tag, attrs)
XML Parser callback
+ +

+ + + + + + + +
 
+class Component(Connection)
   docs to come soon...
 
 
Method resolution order:
+
Component
+
Connection
+
xmlstream.Client
+
xmlstream.Stream
+
xmlstream.NodeBuilder
+
+
+Methods defined here:
+
__init__(self, host, port, connection=1, debug=[], log=0, ns='jabber:component:accept', hostIP=None, proxy=None)
+ +
auth(self, secret)
will disconnect on failure
+ +
dispatch(self, root_node)
Catch the <handshake/> here
+ +
+Methods inherited from Connection:
+
SendAndWaitForResponse(self, obj, ID=None, timeout=300)
Sends a protocol element object and blocks until a response with
+the same ID is received.  The received protocol object is returned
+as the function result.
+ +
getAnID(self)
Returns a unique ID
+ +
header(self)
+ +
registerHandler(self, name, handler, type='', ns='', chained=0, makefirst=0, system=0)
Sets the callback func for processing incoming stanzas.
+Multiple callback functions can be set which are called in
+succession. Callback can optionally raise an NodeProcessed error to
+stop stanza from further processing. A type and namespace attributes can
+also be optionally passed so the callback is only called when a stanza of
+this type is received. Namespace attribute MUST be omitted if you
+registering an Iq processing handler.

+If 'chainOutput' is set to False (the default), the given function
+should be defined as follows:

+     def myCallback(c, p)

+Where the first parameter is the Client object, and the second
+parameter is the [ancestor of] Protocol object representing the stanza
+which was received.

+If 'chainOutput' is set to True, the output from the various
+handler functions will be chained together.  In this case,
+the given callback function should be defined like this:

+     def myCallback(c, p, output)

+Where 'output' is the value returned by the previous
+callback function.  For the first callback routine, 'output' will be
+set to an empty string.

+'makefirst' argument gives you control over handler prioriy in its type
+and namespace scope. Note that handlers for particular type or namespace always
+have lower priority that common handlers.
+ +
registerProtocol(self, tag_name, Proto)
Registers a protocol in protocol processing chain. You MUST register
+a protocol before you register any handler function for it.
+First parameter, that passed to this function is the tag name that
+belongs to all protocol elements. F.e.: message, presence, iq, xdb, ...
+Second parameter is the [ancestor of] Protocol class, which instance will
+built from the received node with call

+     if received_packet.getName()==tag_name:
+         stanza = Proto(node = received_packet)
+ +
send(self, what)
Sends a jabber protocol element (Node) to the server
+ +
setDisconnectHandler(self, func)
Set the callback for a disconnect.
+The given function will be called with a single parameter (the
+connection object) when the connection is broken unexpectedly (eg,
+in response to sending badly formed XML).  self.lastErr and
+self.lastErrCode will be set to the error which caused the
+disconnection, if any.
+ +
setIqHandler(self, func, type='', ns='')
Back compartibility method
+ +
setMessageHandler(self, func, type='', chainOutput=0)
Back compartibility method
+ +
setPresenceHandler(self, func, type='', chainOutput=0)
Back compartibility method
+ +
waitForResponse(self, ID, timeout=300)
Blocks untils a protocol element with the given id is received.
+If an error is received, waitForResponse returns None and
+self.lastErr and self.lastErrCode is set to the received error.  If
+the operation times out (which only happens if a timeout value is
+given), waitForResponse will return None and self.lastErr will be
+set to "Timeout".
+Changed default from timeout=0 to timeout=300 to avoid hangs in
+scripts and such.
+If you _really_ want no timeout, just set it to 0
+ +
+Methods inherited from xmlstream.Client:
+
connect(self)
Attempt to connect to specified host
+ +
getSocket(self)
+ +
+Methods inherited from xmlstream.Stream:
+
disconnect(self)
Close the stream and socket
+ +
disconnectHandler(self, conn)
Called when a Network Error or disconnection occurs.
+Designed to be overidden
+ +
disconnected(self, conn)
Called when a Network Error or disconnection occurs.
+ +
getIncomingID(self)
Returns the streams ID
+ +
getOutgoingID(self)
Returns the streams ID
+ +
log(self, data, inout='')
Logs data to the specified filehandle. Data is time stamped
+and prefixed with inout
+ +
process(self, timeout=0)
Receives incoming data (if any) and processes it.
+Waits for data no more than timeout seconds.
+ +
read(self)
Reads incoming data. Blocks until done. Calls disconnected(self) if appropriate.
+ +
timestampLog(self, timestamp)
Enable or disable the showing of a timestamp in the log.
+By default, timestamping is enabled.
+ +
write(self, raw_data)
Writes raw outgoing data. Blocks until done.
+If supplied data is not unicode string, ENCODING
+is used for convertion. Avoid this!
+Always send your data as a unicode string.
+ +
+Methods inherited from xmlstream.NodeBuilder:
+
DEBUG(self, dup1, dup2=None)
+ +
getDom(self)
+ +
handle_data(self, data)
XML Parser callback
+ +
unknown_endtag(self, tag)
XML Parser callback
+ +
unknown_starttag(self, tag, attrs)
XML Parser callback
+ +

+ + + + + + + +
 
+class Connection(xmlstream.Client)
   Forms the base for both Client and Component Classes
 
 
Method resolution order:
+
Connection
+
xmlstream.Client
+
xmlstream.Stream
+
xmlstream.NodeBuilder
+
+
+Methods defined here:
+
SendAndWaitForResponse(self, obj, ID=None, timeout=300)
Sends a protocol element object and blocks until a response with
+the same ID is received.  The received protocol object is returned
+as the function result.
+ +
__init__(self, host, port, namespace, debug=[], log=0, connection=1, hostIP=None, proxy=None)
+ +
dispatch(self, stanza)
Called internally when a 'protocol element' is received.
+Builds the relevant jabber.py object and dispatches it
+to a relevant function or callback.
+ +
getAnID(self)
Returns a unique ID
+ +
header(self)
+ +
registerHandler(self, name, handler, type='', ns='', chained=0, makefirst=0, system=0)
Sets the callback func for processing incoming stanzas.
+Multiple callback functions can be set which are called in
+succession. Callback can optionally raise an NodeProcessed error to
+stop stanza from further processing. A type and namespace attributes can
+also be optionally passed so the callback is only called when a stanza of
+this type is received. Namespace attribute MUST be omitted if you
+registering an Iq processing handler.

+If 'chainOutput' is set to False (the default), the given function
+should be defined as follows:

+     def myCallback(c, p)

+Where the first parameter is the Client object, and the second
+parameter is the [ancestor of] Protocol object representing the stanza
+which was received.

+If 'chainOutput' is set to True, the output from the various
+handler functions will be chained together.  In this case,
+the given callback function should be defined like this:

+     def myCallback(c, p, output)

+Where 'output' is the value returned by the previous
+callback function.  For the first callback routine, 'output' will be
+set to an empty string.

+'makefirst' argument gives you control over handler prioriy in its type
+and namespace scope. Note that handlers for particular type or namespace always
+have lower priority that common handlers.
+ +
registerProtocol(self, tag_name, Proto)
Registers a protocol in protocol processing chain. You MUST register
+a protocol before you register any handler function for it.
+First parameter, that passed to this function is the tag name that
+belongs to all protocol elements. F.e.: message, presence, iq, xdb, ...
+Second parameter is the [ancestor of] Protocol class, which instance will
+built from the received node with call

+     if received_packet.getName()==tag_name:
+         stanza = Proto(node = received_packet)
+ +
send(self, what)
Sends a jabber protocol element (Node) to the server
+ +
setDisconnectHandler(self, func)
Set the callback for a disconnect.
+The given function will be called with a single parameter (the
+connection object) when the connection is broken unexpectedly (eg,
+in response to sending badly formed XML).  self.lastErr and
+self.lastErrCode will be set to the error which caused the
+disconnection, if any.
+ +
setIqHandler(self, func, type='', ns='')
Back compartibility method
+ +
setMessageHandler(self, func, type='', chainOutput=0)
Back compartibility method
+ +
setPresenceHandler(self, func, type='', chainOutput=0)
Back compartibility method
+ +
waitForResponse(self, ID, timeout=300)
Blocks untils a protocol element with the given id is received.
+If an error is received, waitForResponse returns None and
+self.lastErr and self.lastErrCode is set to the received error.  If
+the operation times out (which only happens if a timeout value is
+given), waitForResponse will return None and self.lastErr will be
+set to "Timeout".
+Changed default from timeout=0 to timeout=300 to avoid hangs in
+scripts and such.
+If you _really_ want no timeout, just set it to 0
+ +
+Methods inherited from xmlstream.Client:
+
connect(self)
Attempt to connect to specified host
+ +
getSocket(self)
+ +
+Methods inherited from xmlstream.Stream:
+
disconnect(self)
Close the stream and socket
+ +
disconnectHandler(self, conn)
Called when a Network Error or disconnection occurs.
+Designed to be overidden
+ +
disconnected(self, conn)
Called when a Network Error or disconnection occurs.
+ +
getIncomingID(self)
Returns the streams ID
+ +
getOutgoingID(self)
Returns the streams ID
+ +
log(self, data, inout='')
Logs data to the specified filehandle. Data is time stamped
+and prefixed with inout
+ +
process(self, timeout=0)
Receives incoming data (if any) and processes it.
+Waits for data no more than timeout seconds.
+ +
read(self)
Reads incoming data. Blocks until done. Calls disconnected(self) if appropriate.
+ +
timestampLog(self, timestamp)
Enable or disable the showing of a timestamp in the log.
+By default, timestamping is enabled.
+ +
write(self, raw_data)
Writes raw outgoing data. Blocks until done.
+If supplied data is not unicode string, ENCODING
+is used for convertion. Avoid this!
+Always send your data as a unicode string.
+ +
+Methods inherited from xmlstream.NodeBuilder:
+
DEBUG(self, dup1, dup2=None)
+ +
getDom(self)
+ +
handle_data(self, data)
XML Parser callback
+ +
unknown_endtag(self, tag)
XML Parser callback
+ +
unknown_starttag(self, tag, attrs)
XML Parser callback
+ +

+ + + + + + + +
 
+class Iq(Protocol)
   Class for creating and managing jabber <iq> protocol
+elements
 
 
Method resolution order:
+
Iq
+
Protocol
+
xmlstream.Node
+
+
+Methods defined here:
+
__init__(self, to=None, type=None, query=None, attrs=None, frm=None, payload=[], node=None)
+ +
getList(self)
returns the list namespace
+ +
getQuery(self)
returns the query namespace
+ +
getQueryNode(self)
Returns any textual data contained by the query tag
+ +
getQueryPayload(self)
Returns the query's payload as a Node list
+ +
setList(self, namespace)
+ +
setQuery(self, namespace)
Sets a query's namespace, and inserts a query tag if
+one doesn't already exist.  The resulting query tag
+is returned as the function result.
+ +
setQueryNode(self, val)
Sets textual data contained by the query tag
+ +
setQueryPayload(self, payload, add=0)
Sets a Iq's query payload.  'payload' can be either a Node
+structure or a valid xml document. The query tag is automatically
+inserted if it doesn't already exist.
+ +
+Methods inherited from Protocol:
+
__repr__(self)
+ +
asNode(self)
Back compartibility method
+ +
fromTo(self)
Swaps the element's from and to attributes.
+Note that this is only useful for writing components; if you are
+writing a Jabber client you shouldn't use this, because the Jabber
+server will set the 'from' field automatically.
+ +
getError(self)
Returns the error string, if any
+ +
getErrorCode(self)
Returns the error code, if any
+ +
getFrom(self)
Returns the 'from' attribute as a JID object.
+ +
getID(self)
Returns the 'id' attribute of the protocol element.
+ +
getTo(self)
Returns the 'to' attribute as a JID object.
+ +
getType(self)
Returns the 'type' attribute of the protocol element.
+ +
getX(self, index=0)
Returns the x namespace, optionally passed an index if there are
+multiple tags.
+ +
getXNode(self, val=None)
Returns the x Node instance. If there are multiple tags
+the first Node is returned. For multiple X nodes use getXNodes
+or pass an index integer value or namespace string to getXNode
+and if a match is found it will be returned.
+ +
getXNodes(self)
Returns a list of X nodes.
+ +
getXPayload(self, val=None)
Returns the x tags' payload as a list of Node instances.
+ +
setError(self, val, code)
Sets an error string and code
+ +
setFrom(self, val)
Sets the 'from' element to the given JID.
+ +
setID(self, val)
Sets the ID of the protocol element
+ +
setTo(self, val)
Sets the 'to' element to the given JID.
+ +
setType(self, val)
Sets the 'type' attribute of the protocol element
+ +
setX(self, namespace, index=0)
Sets the name space of the x tag. It also creates the node
+if it doesn't already exist.
+ +
setXNode(self, val='')
Sets the x tag's data to the given textual value.
+ +
setXPayload(self, payload, namespace='')
Sets the Child of an 'x' tag. Can be a Node instance or an
+XML document
+ +
+Methods inherited from xmlstream.Node:
+
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + + + +
 
+class JID
   A Simple class for managing jabber users id's
 
 Methods defined here:
+
__eq__(self, other)
Returns whether this JID is identical to another one.
+The "other" can be a JID object or a string.
+ +
__init__(self, jid='', node='', domain='', resource='')
+ +
__repr__ = __str__(self)
+ +
__str__(self)
+ +
getDomain(self)
Returns JID domain as string or None if absent
+ +
getNode(self)
Returns JID Node as string
+ +
getResource(self)
Returns JID resource as string or None if absent
+ +
getStripped(self)
Returns a JID string with no resource
+ +
setDomain(self, val)
Sets JID domain from string
+ +
setNode(self, val)
Sets JID Node from string
+ +
setResource(self, val)
Sets JID resource from string
+ +

+ + + + + +
 
+class Log(Protocol)
    
Method resolution order:
+
Log
+
Protocol
+
xmlstream.Node
+
+
+Methods defined here:
+
__init__(self, attrs=None, type=None, frm=None, to=None, payload=[], node=None)
## eg: <log type='warn' from='component'>Hello Log File</log>
+ +
getBody(self)
Returns the log message text.
+ +
setBody(self, val)
Sets the log message text.
+ +
+Methods inherited from Protocol:
+
__repr__(self)
+ +
asNode(self)
Back compartibility method
+ +
fromTo(self)
Swaps the element's from and to attributes.
+Note that this is only useful for writing components; if you are
+writing a Jabber client you shouldn't use this, because the Jabber
+server will set the 'from' field automatically.
+ +
getError(self)
Returns the error string, if any
+ +
getErrorCode(self)
Returns the error code, if any
+ +
getFrom(self)
Returns the 'from' attribute as a JID object.
+ +
getID(self)
Returns the 'id' attribute of the protocol element.
+ +
getTo(self)
Returns the 'to' attribute as a JID object.
+ +
getType(self)
Returns the 'type' attribute of the protocol element.
+ +
getX(self, index=0)
Returns the x namespace, optionally passed an index if there are
+multiple tags.
+ +
getXNode(self, val=None)
Returns the x Node instance. If there are multiple tags
+the first Node is returned. For multiple X nodes use getXNodes
+or pass an index integer value or namespace string to getXNode
+and if a match is found it will be returned.
+ +
getXNodes(self)
Returns a list of X nodes.
+ +
getXPayload(self, val=None)
Returns the x tags' payload as a list of Node instances.
+ +
setError(self, val, code)
Sets an error string and code
+ +
setFrom(self, val)
Sets the 'from' element to the given JID.
+ +
setID(self, val)
Sets the ID of the protocol element
+ +
setTo(self, val)
Sets the 'to' element to the given JID.
+ +
setType(self, val)
Sets the 'type' attribute of the protocol element
+ +
setX(self, namespace, index=0)
Sets the name space of the x tag. It also creates the node
+if it doesn't already exist.
+ +
setXNode(self, val='')
Sets the x tag's data to the given textual value.
+ +
setXPayload(self, payload, namespace='')
Sets the Child of an 'x' tag. Can be a Node instance or an
+XML document
+ +
+Methods inherited from xmlstream.Node:
+
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + + + +
 
+class Message(Protocol)
   Builds on the Protocol class to provide an interface for sending
+message protocol elements
 
 
Method resolution order:
+
Message
+
Protocol
+
xmlstream.Node
+
+
+Methods defined here:
+
__init__(self, to=None, body=None, type=None, subject=None, attrs=None, frm=None, payload=[], node=None)
+ +
buildReply(self, reply_txt='')
Returns a new Message object as a reply to itself.
+The reply message has the 'to', 'type' and 'thread' attributes
+automatically set.
+ +
build_reply(self, reply_txt='')
+ +
getBody(self)
Returns the message body.
+ +
getSubject(self)
Returns the message's subject.
+ +
getThread(self)
Returns the message's thread ID.
+ +
getTimestamp(self)
+ +
setBody(self, val)
Sets the message body text.
+ +
setSubject(self, val)
Sets the message subject text.
+ +
setThread(self, val)
Sets the message thread ID.
+ +
setTimestamp(self, val=None)
+ +
+Methods inherited from Protocol:
+
__repr__(self)
+ +
asNode(self)
Back compartibility method
+ +
fromTo(self)
Swaps the element's from and to attributes.
+Note that this is only useful for writing components; if you are
+writing a Jabber client you shouldn't use this, because the Jabber
+server will set the 'from' field automatically.
+ +
getError(self)
Returns the error string, if any
+ +
getErrorCode(self)
Returns the error code, if any
+ +
getFrom(self)
Returns the 'from' attribute as a JID object.
+ +
getID(self)
Returns the 'id' attribute of the protocol element.
+ +
getTo(self)
Returns the 'to' attribute as a JID object.
+ +
getType(self)
Returns the 'type' attribute of the protocol element.
+ +
getX(self, index=0)
Returns the x namespace, optionally passed an index if there are
+multiple tags.
+ +
getXNode(self, val=None)
Returns the x Node instance. If there are multiple tags
+the first Node is returned. For multiple X nodes use getXNodes
+or pass an index integer value or namespace string to getXNode
+and if a match is found it will be returned.
+ +
getXNodes(self)
Returns a list of X nodes.
+ +
getXPayload(self, val=None)
Returns the x tags' payload as a list of Node instances.
+ +
setError(self, val, code)
Sets an error string and code
+ +
setFrom(self, val)
Sets the 'from' element to the given JID.
+ +
setID(self, val)
Sets the ID of the protocol element
+ +
setTo(self, val)
Sets the 'to' element to the given JID.
+ +
setType(self, val)
Sets the 'type' attribute of the protocol element
+ +
setX(self, namespace, index=0)
Sets the name space of the x tag. It also creates the node
+if it doesn't already exist.
+ +
setXNode(self, val='')
Sets the x tag's data to the given textual value.
+ +
setXPayload(self, payload, namespace='')
Sets the Child of an 'x' tag. Can be a Node instance or an
+XML document
+ +
+Methods inherited from xmlstream.Node:
+
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + +
 
+class NodeProcessed(exceptions.Exception)
    Methods inherited from exceptions.Exception:
+
__getitem__(...)
+ +
__init__(...)
+ +
__str__(...)
+ +

+ + + + + + + +
 
+class Presence(Protocol)
   Class for creating and managing jabber <presence> protocol
+elements
 
 
Method resolution order:
+
Presence
+
Protocol
+
xmlstream.Node
+
+
+Methods defined here:
+
__init__(self, to=None, type=None, priority=None, show=None, status=None, attrs=None, frm=None, payload=[], node=None)
+ +
getPriority(self)
Returns the presence priority
+ +
getShow(self)
Returns the presence show
+ +
getStatus(self)
Returns the presence status
+ +
setPriority(self, val)
Sets the presence priority
+ +
setShow(self, val)
Sets the presence show
+ +
setStatus(self, val)
Sets the presence status
+ +
+Methods inherited from Protocol:
+
__repr__(self)
+ +
asNode(self)
Back compartibility method
+ +
fromTo(self)
Swaps the element's from and to attributes.
+Note that this is only useful for writing components; if you are
+writing a Jabber client you shouldn't use this, because the Jabber
+server will set the 'from' field automatically.
+ +
getError(self)
Returns the error string, if any
+ +
getErrorCode(self)
Returns the error code, if any
+ +
getFrom(self)
Returns the 'from' attribute as a JID object.
+ +
getID(self)
Returns the 'id' attribute of the protocol element.
+ +
getTo(self)
Returns the 'to' attribute as a JID object.
+ +
getType(self)
Returns the 'type' attribute of the protocol element.
+ +
getX(self, index=0)
Returns the x namespace, optionally passed an index if there are
+multiple tags.
+ +
getXNode(self, val=None)
Returns the x Node instance. If there are multiple tags
+the first Node is returned. For multiple X nodes use getXNodes
+or pass an index integer value or namespace string to getXNode
+and if a match is found it will be returned.
+ +
getXNodes(self)
Returns a list of X nodes.
+ +
getXPayload(self, val=None)
Returns the x tags' payload as a list of Node instances.
+ +
setError(self, val, code)
Sets an error string and code
+ +
setFrom(self, val)
Sets the 'from' element to the given JID.
+ +
setID(self, val)
Sets the ID of the protocol element
+ +
setTo(self, val)
Sets the 'to' element to the given JID.
+ +
setType(self, val)
Sets the 'type' attribute of the protocol element
+ +
setX(self, namespace, index=0)
Sets the name space of the x tag. It also creates the node
+if it doesn't already exist.
+ +
setXNode(self, val='')
Sets the x tag's data to the given textual value.
+ +
setXPayload(self, payload, namespace='')
Sets the Child of an 'x' tag. Can be a Node instance or an
+XML document
+ +
+Methods inherited from xmlstream.Node:
+
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + + + +
 
+class Protocol(xmlstream.Node)
   Base class for jabber 'protocol elements' - messages, presences and iqs.
+Implements methods that are common to all these
 
 Methods defined here:
+
__init__(self, name=None, to=None, type=None, attrs=None, frm=None, payload=[], node=None)
+ +
__repr__(self)
+ +
asNode(self)
Back compartibility method
+ +
fromTo(self)
Swaps the element's from and to attributes.
+Note that this is only useful for writing components; if you are
+writing a Jabber client you shouldn't use this, because the Jabber
+server will set the 'from' field automatically.
+ +
getError(self)
Returns the error string, if any
+ +
getErrorCode(self)
Returns the error code, if any
+ +
getFrom(self)
Returns the 'from' attribute as a JID object.
+ +
getID(self)
Returns the 'id' attribute of the protocol element.
+ +
getTo(self)
Returns the 'to' attribute as a JID object.
+ +
getType(self)
Returns the 'type' attribute of the protocol element.
+ +
getX(self, index=0)
Returns the x namespace, optionally passed an index if there are
+multiple tags.
+ +
getXNode(self, val=None)
Returns the x Node instance. If there are multiple tags
+the first Node is returned. For multiple X nodes use getXNodes
+or pass an index integer value or namespace string to getXNode
+and if a match is found it will be returned.
+ +
getXNodes(self)
Returns a list of X nodes.
+ +
getXPayload(self, val=None)
Returns the x tags' payload as a list of Node instances.
+ +
setError(self, val, code)
Sets an error string and code
+ +
setFrom(self, val)
Sets the 'from' element to the given JID.
+ +
setID(self, val)
Sets the ID of the protocol element
+ +
setTo(self, val)
Sets the 'to' element to the given JID.
+ +
setType(self, val)
Sets the 'type' attribute of the protocol element
+ +
setX(self, namespace, index=0)
Sets the name space of the x tag. It also creates the node
+if it doesn't already exist.
+ +
setXNode(self, val='')
Sets the x tag's data to the given textual value.
+ +
setXPayload(self, payload, namespace='')
Sets the Child of an 'x' tag. Can be a Node instance or an
+XML document
+ +
+Methods inherited from xmlstream.Node:
+
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + + + +
 
+class Roster
   A Class for simplifying roster management. Also tracks roster
+item availability.
 
 Methods defined here:
+
__init__(self)
+ +
getAsk(self, jid)
Returns the 'ask' status for a Roster item with the given jid.
+ +
getGroups(self, jid)
Returns the lsit of groups associated with the given roster item.
+ +
getJIDs(self)
Returns a list of JIDs stored within the roster.  Each entry in the
+list is a JID object.
+ +
getName(self, jid)
Returns the 'name' for a Roster item with the given jid.
+ +
getOnline(self, jid)
Returns the 'online' status for a Roster item with the given jid.
+ +
getRaw(self)
Returns the internal data representation of the roster.
+ +
getShow(self, jid)
Returns the 'show' value for a Roster item with the given jid.
+ +
getStatus(self, jid)
Returns the 'status' value for a Roster item with the given jid.
+ +
getSub(self, jid)
Returns the 'subscription' status for a Roster item with the given
+jid.
+ +
getSummary(self)
Returns a summary of the roster's contents.  The returned value is a
+dictionary mapping the basic (no resource) JIDs to their current
+availability status (online, offline, pending).
+ +
isOnline(self, jid)
Returns True if the given jid is online, False if not.
+ +
setListener(self, listener)
Set a listener function to be called whenever the roster changes.

+The given function will be called whenever the contents of the
+roster changes in response to a received <presence> or <iq> packet.
+The listener function should be defined as follows:

+    def listener(action, jid, info)

+'action' is a string indicating what type of change has occurred:

+    "add"     A new item has been added to the roster.
+    "update"  An existing roster item has been updated.
+    "remove"  A roster entry has been removed.

+'jid' is the Jabber ID (as a string) of the affected roster entry.

+'info' is a dictionary containing the information that has been
+added or updated for this roster entry.  This dictionary may
+contain any combination of the following:

+    "name"    The associated name of this roster entry.
+    "groups"  A list of groups associated with this roster entry.
+    "online"  The roster entry's "online" value ("online",
+              "offline" or "pending").
+    "sub"     The roster entry's subscription value ("none",
+              "from", "to" or "both").
+    "ask"     The roster entry's ask value, if any (None,
+              "subscribe", "unsubscribe").
+    "show"    The roster entry's show value, if any (None, "away",
+              "chat", "dnd", "normal", "xa").
+    "status"  The roster entry's current 'status' value, if
+              specified.
+ +

+ + + + + +
 
+class Server
    

+ + + + + +
 
+class XDB(Protocol)
    
Method resolution order:
+
XDB
+
Protocol
+
xmlstream.Node
+
+
+Methods defined here:
+
__init__(self, attrs=None, type=None, frm=None, to=None, payload=[], node=None)
+ +
+Methods inherited from Protocol:
+
__repr__(self)
+ +
asNode(self)
Back compartibility method
+ +
fromTo(self)
Swaps the element's from and to attributes.
+Note that this is only useful for writing components; if you are
+writing a Jabber client you shouldn't use this, because the Jabber
+server will set the 'from' field automatically.
+ +
getError(self)
Returns the error string, if any
+ +
getErrorCode(self)
Returns the error code, if any
+ +
getFrom(self)
Returns the 'from' attribute as a JID object.
+ +
getID(self)
Returns the 'id' attribute of the protocol element.
+ +
getTo(self)
Returns the 'to' attribute as a JID object.
+ +
getType(self)
Returns the 'type' attribute of the protocol element.
+ +
getX(self, index=0)
Returns the x namespace, optionally passed an index if there are
+multiple tags.
+ +
getXNode(self, val=None)
Returns the x Node instance. If there are multiple tags
+the first Node is returned. For multiple X nodes use getXNodes
+or pass an index integer value or namespace string to getXNode
+and if a match is found it will be returned.
+ +
getXNodes(self)
Returns a list of X nodes.
+ +
getXPayload(self, val=None)
Returns the x tags' payload as a list of Node instances.
+ +
setError(self, val, code)
Sets an error string and code
+ +
setFrom(self, val)
Sets the 'from' element to the given JID.
+ +
setID(self, val)
Sets the ID of the protocol element
+ +
setTo(self, val)
Sets the 'to' element to the given JID.
+ +
setType(self, val)
Sets the 'type' attribute of the protocol element
+ +
setX(self, namespace, index=0)
Sets the name space of the x tag. It also creates the node
+if it doesn't already exist.
+ +
setXNode(self, val='')
Sets the x tag's data to the given textual value.
+ +
setXPayload(self, payload, namespace='')
Sets the Child of an 'x' tag. Can be a Node instance or an
+XML document
+ +
+Methods inherited from xmlstream.Node:
+
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + +
 
+Functions
       
ustr(what)
If sending object is already a unicode str, just
+return it, otherwise convert it using xmlstream.ENCODING
+

+ + + + + +
 
+Data
       DBG_ALWAYS = 'always'
+DBG_DISPATCH = 'jb-dispatch'
+DBG_INIT = 'init'
+DBG_NODE = 'jb-node'
+DBG_NODE_IQ = 'jb-node-iq'
+DBG_NODE_MESSAGE = 'jb-node-message'
+DBG_NODE_PRESENCE = 'jb-node-pressence'
+DBG_NODE_UNKNOWN = 'jb-node-unknown'
+False = 0
+NS_AGENT = 'jabber:iq:agent'
+NS_AGENTS = 'jabber:iq:agents'
+NS_AUTH = 'jabber:iq:auth'
+NS_BROWSE = 'jabber:iq:browse'
+NS_CLIENT = 'jabber:client'
+NS_COMP_ACCEPT = 'jabber:component:accept'
+NS_COMP_CONNECT = 'jabber:component:connect'
+NS_DELAY = 'jabber:x:delay'
+NS_LAST = 'jabber:iq:last'
+NS_OOB = 'jabber:iq:oob'
+NS_PASS = 'jabber:iq:pass'
+NS_PRIVACY = 'jabber:iq:privacy'
+NS_P_COMMANDS = 'http://jabber.org/protocol/commands'
+NS_P_DISC_INFO = 'http://jabber.org/protocol/disco#info'
+NS_P_DISC_ITEMS = 'http://jabber.org/protocol/disco#items'
+NS_P_MUC = 'http://jabber.org/protocol/muc'
+NS_REGISTER = 'jabber:iq:register'
+NS_ROSTER = 'jabber:iq:roster'
+NS_RPC = 'jabber:iq:rpc'
+NS_SERVER = 'jabber:server'
+NS_TIME = 'jabber:iq:time'
+NS_VCARD = 'vcard-temp'
+NS_VERSION = 'jabber:iq:version'
+NS_XDATA = 'jabber:x:data'
+NS_XENCRYPTED = 'jabber:x:encrypted'
+NS_XEVENT = 'jabber:x:event'
+NS_XEXPIRE = 'jabber:x:expire'
+NS_XROSTER = 'jabber:x:roster'
+NS_XSIGNED = 'jabber:x:signed'
+RS_ASK_SUBSCRIBE = 1
+RS_ASK_UNSUBSCRIBE = 0
+RS_EXT_OFFLINE = 1
+RS_EXT_ONLINE = 2
+RS_EXT_PENDING = 0
+RS_SUB_BOTH = 0
+RS_SUB_FROM = 1
+RS_SUB_TO = 2
+True = 1
+VERSION = '0.5'
+timeout = 300
+ \ No newline at end of file --- jabber.py-0.5.0.orig/debian/pycompat +++ jabber.py-0.5.0/debian/pycompat @@ -0,0 +1 @@ +2 --- jabber.py-0.5.0.orig/debian/python-jabber.docs +++ jabber.py-0.5.0/debian/python-jabber.docs @@ -0,0 +1,4 @@ +docs/ +patches/ +README +CREDITS --- jabber.py-0.5.0.orig/debian/python-jabber.examples +++ jabber.py-0.5.0/debian/python-jabber.examples @@ -0,0 +1 @@ +examples/* --- jabber.py-0.5.0.orig/debian/rules +++ jabber.py-0.5.0/debian/rules @@ -0,0 +1,89 @@ +#!/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 +PYVERS:=$(shell pyversions -r) + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +build: build-stamp +build-stamp: + dh_testdir + + set -e; \ + for py in $(PYVERS); do \ + $$py setup.py build; done + + #/usr/bin/docbook-to-man debian/python-jabber.sgml > python-jabber.1 + + touch build-stamp jabber/__init__.py + +clean: + dh_testdir + dh_testroot + -for py in $(PYVERS); do \ + $$py setup.py clean --all; done + + find $(CURDIR) -name \*.pyc -exec rm -f {} \; + find $(CURDIR) -name \*.pyo -exec rm -f {} \; + rm -f build-stamp jabber/__init__.py + rm -rf docs + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs -v + + set -e; \ + for py in $(PYVERS); do \ + $$py setup.py install --root=debian/python-jabber; \ + done + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + dh_testdir -i + dh_testroot -i + + # Decode some imgs for html docs + install -d $(CURDIR)/docs/img/ + install -d $(CURDIR)/docs/docs/ + uudecode -o $(CURDIR)/docs/img/logo-56-80.png \ + $(CURDIR)/debian/img/logo-56-80.png.b64 + uudecode -o $(CURDIR)/docs/img/jabber-powered-20.png \ + $(CURDIR)/debian/img/jabber-powered-20.png.b64 + install -m 0644 $(CURDIR)/debian/jabber.html \ + $(CURDIR)/debian/xmlstream.html \ + $(CURDIR)/docs/docs/ + + dh_installdocs -i + dh_installexamples -i + dh_installchangelogs -i + dh_link -i + dh_compress -i -X.py -X.xpm + dh_fixperms -i + dh_python2 -i + dh_installdeb -i + dh_shlibdeps -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- jabber.py-0.5.0.orig/debian/xmlstream.html +++ jabber.py-0.5.0/debian/xmlstream.html @@ -0,0 +1,338 @@ + + +Python: module xmlstream + + + + +
 
+ 
xmlstream
index
/home/kalfa/debian/mypackages/jabber.py/jabber.py-0.5.0/jabber/xmlstream.py
+

xmlstream.py provides simple functionality for implementing
+XML stream based network protocols. It is used as a  base
+for jabber.py.

+xmlstream.py manages the network connectivity and xml parsing
+of the stream. When a complete 'protocol element' ( meaning a
+complete child of the xmlstreams root ) is parsed the dipatch
+method is called with a 'Node' instance of this structure.
+The Node class is a very simple XML DOM like class for
+manipulating XML documents or 'protocol elements' in this
+case.

+

+ + + + + +
 
+Modules
       
debug
+debug
+
re
+socket
+
sys
+time
+
_xmlplus
+

+ + + + + +
 
+Classes
       
+
Node +
NodeBuilder +
+
+
Stream +
+
+
Client +
+
+
+
+
Server +
error +
+

+ + + + + +
 
+class Client(Stream)
    
Method resolution order:
+
Client
+
Stream
+
NodeBuilder
+
+
+Methods defined here:
+
__init__(self, host, port, namespace, debug=['always'], log=None, sock=None, id=None, connection=1, hostIP=None, proxy=None)
+ +
connect(self)
Attempt to connect to specified host
+ +
getSocket(self)
+ +
+Methods inherited from Stream:
+
disconnect(self)
Close the stream and socket
+ +
disconnectHandler(self, conn)
Called when a Network Error or disconnection occurs.
+Designed to be overidden
+ +
disconnected(self, conn)
Called when a Network Error or disconnection occurs.
+ +
getIncomingID(self)
Returns the streams ID
+ +
getOutgoingID(self)
Returns the streams ID
+ +
log(self, data, inout='')
Logs data to the specified filehandle. Data is time stamped
+and prefixed with inout
+ +
process(self, timeout=0)
Receives incoming data (if any) and processes it.
+Waits for data no more than timeout seconds.
+ +
read(self)
Reads incoming data. Blocks until done. Calls disconnected(self) if appropriate.
+ +
timestampLog(self, timestamp)
Enable or disable the showing of a timestamp in the log.
+By default, timestamping is enabled.
+ +
write(self, raw_data)
Writes raw outgoing data. Blocks until done.
+If supplied data is not unicode string, ENCODING
+is used for convertion. Avoid this!
+Always send your data as a unicode string.
+ +
+Methods inherited from NodeBuilder:
+
DEBUG(self, dup1, dup2=None)
+ +
dispatch(self, dom)
+ +
getDom(self)
+ +
handle_data(self, data)
XML Parser callback
+ +
unknown_endtag(self, tag)
XML Parser callback
+ +
unknown_starttag(self, tag, attrs)
XML Parser callback
+ +

+ + + + + + + +
 
+class Node
   A simple XML DOM like class
 
 Methods defined here:
+
__init__(self, tag=None, parent=None, attrs={}, payload=[], node=None)
+ +
__str__(self)
+ +
getAttr(self, key)
Get a value for the nodes named attribute.
+ +
getChildren(self)
Returns a nodes children
+ +
getData(self)
Return the nodes textual data
+ +
getDataAsParts(self)
Return the node data as an array
+ +
getName(self)
Set the nodes tag name.
+ +
getNamespace(self)
Returns the nodes namespace.
+ +
getParent(self)
return the nodes parent node.
+ +
getTag(self, name, index=None)
Returns a child node with tag name. Returns None
+if not found.
+ +
getTags(self, name)
Like getTag but returns a list with matching child nodes
+ +
insertData(self, data)
Set the nodes textual data
+ +
insertNode(self, node)
Add a child node to the node
+ +
insertTag(self, name=None, attrs={}, payload=[], node=None)
Add a child tag of name 'name' to the node.

+Returns the newly created node.
+ +
insertXML(self, xml_str)
Add raw xml as a child of the node
+ +
putAttr(self, key, val)
Add a name/value attribute to the node.
+ +
putData(self, data)
Set the nodes textual data
+ +
removeTag(self, tag)
Pops out specified child and returns it.
+ +
setName(self, val)
Set the nodes tag name.
+ +
setNamespace(self, namespace)
Set the nodes namespace.
+ +
setParent(self, node)
Set the nodes parent node.
+ +

+ + + + + + + +
 
+class NodeBuilder
   builds a 'minidom' from data parsed to it. Primarily for insertXML
+method of Node
 
 Methods defined here:
+
DEBUG(self, dup1, dup2=None)
+ +
__init__(self, data=None)
+ +
dispatch(self, dom)
+ +
getDom(self)
+ +
handle_data(self, data)
XML Parser callback
+ +
unknown_endtag(self, tag)
XML Parser callback
+ +
unknown_starttag(self, tag, attrs)
XML Parser callback
+ +

+ + + + + +
 
+class Server
    Methods defined here:
+
__init__(self, maxclients=10)
+ +
now(self)
+ +
serve(self)
+ +

+ + + + + + + +
 
+class Stream(NodeBuilder)
   Extention of NodeBuilder class. Handles stream of XML stanzas.
+Calls dispatch method for every child of root node
+(stream:stream for jabber stream).
+attributes _read, _write and _reader must be set by external entity
 
 Methods defined here:
+
__init__(self, namespace, debug=['always'], log=None, id=None, timestampLog=1)
+ +
connect(self)
+ +
disconnect(self)
Close the stream and socket
+ +
disconnectHandler(self, conn)
Called when a Network Error or disconnection occurs.
+Designed to be overidden
+ +
disconnected(self, conn)
Called when a Network Error or disconnection occurs.
+ +
getIncomingID(self)
Returns the streams ID
+ +
getOutgoingID(self)
Returns the streams ID
+ +
log(self, data, inout='')
Logs data to the specified filehandle. Data is time stamped
+and prefixed with inout
+ +
process(self, timeout=0)
Receives incoming data (if any) and processes it.
+Waits for data no more than timeout seconds.
+ +
read(self)
Reads incoming data. Blocks until done. Calls disconnected(self) if appropriate.
+ +
timestampLog(self, timestamp)
Enable or disable the showing of a timestamp in the log.
+By default, timestamping is enabled.
+ +
write(self, raw_data)
Writes raw outgoing data. Blocks until done.
+If supplied data is not unicode string, ENCODING
+is used for convertion. Avoid this!
+Always send your data as a unicode string.
+ +
+Methods inherited from NodeBuilder:
+
DEBUG(self, dup1, dup2=None)
+ +
dispatch(self, dom)
+ +
getDom(self)
+ +
handle_data(self, data)
XML Parser callback
+ +
unknown_endtag(self, tag)
XML Parser callback
+ +
unknown_starttag(self, tag, attrs)
XML Parser callback
+ +

+ + + + + +
 
+class error
    Methods defined here:
+
__init__(self, value)
+ +
__str__(self)
+ +

+ + + + + +
 
+Functions
       
XMLescape(txt)
Escape XML entities
+
XMLunescape(txt)
Unescape XML entities
+
select(...)
select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)

+Wait until one or more file descriptors are ready for some kind of I/O.
+The first three arguments are lists of file descriptors to be waited for:
+rlist -- wait until ready for reading
+wlist -- wait until ready for writing
+xlist -- wait for an ``exceptional condition''
+If only one kind of condition is required, pass [] for the other lists.
+A file descriptor is either a socket or file object, or a small integer
+gotten from a fileno() method call on one of those.

+The optional 4th argument specifies a timeout in seconds; it may be
+a floating point number to specify fractions of seconds.  If it is absent
+or None, the call will never time out.

+The return value is a tuple of three lists corresponding to the first three
+arguments; each contains the subset of the corresponding file descriptors
+that are ready.

+*** IMPORTANT NOTICE ***
+On Windows, only sockets are supported; on Unix, all file descriptors.
+

+ + + + + +
 
+Data
       BLOCK_SIZE = 1024
+DBG_ALWAYS = 'always'
+DBG_CONN_ERROR = 'conn-error'
+DBG_INIT = 'init'
+DBG_XML = ['xml-parse', 'xml-raw']
+DBG_XML_PARSE = 'xml-parse'
+DBG_XML_RAW = 'xml-raw'
+ENCODING = 'utf-8'
+False = 0
+STDIO = 0
+TCP = 1
+TCP_SSL = 2
+True = 1
+VERSION = '0.5'
+ \ No newline at end of file --- jabber.py-0.5.0.orig/examples/pypguijab.py +++ jabber.py-0.5.0/examples/pypguijab.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python2.2 -# we require Python 2.2 because PyPicoGUI does +#!/usr/bin/env python import PicoGUI import socket --- jabber.py-0.5.0.orig/patches/10jabber.Client.auth.patch +++ jabber.py-0.5.0/patches/10jabber.Client.auth.patch @@ -0,0 +1,23 @@ +diff -Nr -U 4 debian/jabber.py patched/jabber.py +--- debian/jabber.py 2003-08-12 17:27:53.000000000 +0400 ++++ patched/jabber.py 2003-10-02 08:20:13.000000000 +0400 +@@ -675,17 +675,17 @@ + q.insertTag('password').insertData(passwd) + + iq_result = self.SendAndWaitForResponse(auth_set_iq) + ++ if iq_result==None: ++ return False + if iq_result.getError() is None: + return True + else: + self.lastErr = iq_result.getError() + self.lastErrCode = iq_result.getErrorCode() + # raise error(iq_result.getError()) ? + return False +- if iq_result is None: +- return False + return True + + ## Roster 'helper' func's - also see the Roster class ## + --- jabber.py-0.5.0.orig/patches/10jabber.py_TyposFIXES.diff +++ jabber.py-0.5.0/patches/10jabber.py_TyposFIXES.diff @@ -0,0 +1,27 @@ +--- jabber.py 2003-03-23 18:12:05.000000000 +0300 ++++ jabber.corr.py 2003-06-21 14:49:27.000000000 +0400 +@@ -68,7 +68,7 @@ + import sha, time + from string import split,find,replace + +-VERSION = 0.3 ++VERSION = 0.4 + + False = 0; + True = 1; +@@ -722,12 +722,12 @@ + """ + iq = Iq(type='set') + item = iq.setQuery(NS_ROSTER).insertTag('item') +- item.putAtrr('jid', str(jid)) +- if name != None: item.putAtrr('name', name) ++ item.putAttr('jid', str(jid)) ++ if name != None: item.putAttr('name', name) + if groups != None: + for group in groups: + item.insertTag('group').insertData(group) +- dummy = self.sendAndWaitForResponse(iq) # Do we need to wait?? ++ dummy = self.SendAndWaitForResponse(iq) # Do we need to wait?? + + + def removeRosterItem(self,jid): --- jabber.py-0.5.0.orig/patches/10xmlstream.py_unicode.diff +++ jabber.py-0.5.0/patches/10xmlstream.py_unicode.diff @@ -0,0 +1,11 @@ +--- xmlstream.py.orig 2003-07-02 17:19:00.000000000 +0400 ++++ xmlstream.py 2003-07-22 17:08:28.000000000 +0400 +@@ -390,7 +390,7 @@ + data_in = action(buff_size) + while data_in: + data = data + data_in +- if len(data_in) != buff_size: ++ if len(data_in) != buff_size and data[-buff_size:].rstrip()[-1]=='>': + break + data_in = action(buff_size) + return data --- jabber.py-0.5.0.orig/patches/README +++ jabber.py-0.5.0/patches/README @@ -0,0 +1,10 @@ +old/ - Those patches had been applied in Debian source package, but not in + upstream one during the release 0.3.1, but it seems to be + useless at the current version. + +unused/ - Those patches has been proposed for 0.3.1 release by some + users but not used. They probably are out of date. + + +File a bug against Debian BTS and propose it to jabber.py.sf.net +mailinglists if you will find a problem. --- jabber.py-0.5.0.orig/patches/old/10xmlstream.py_SSL_v0.3.1.diff +++ jabber.py-0.5.0/patches/old/10xmlstream.py_SSL_v0.3.1.diff @@ -0,0 +1,38 @@ +--- /usr/lib/python2.2/site-packages/xmlstream.py Sat Jun 1 15:45:09 2002 ++++ /home/kalfa/download/jabber/jabber.py-0.3-1/xmlstream.py Thu Jan 17 13:05:40 2002 +@@ -379,12 +379,12 @@ + + if self._connection == TCP_SSL: + data_in = data_in + \ +- unicode(self._sslObj.read(BLOCK_SIZE),'utf-8').encode(ENCODING,'replace') ++ unicode(self._sslObj.recv(BLOCK_SIZE),'utf-8').encode(ENCODING,'replace') + while data_in: + data = data + data_in + if len(data_in) != BLOCK_SIZE: + break +- data_in = unicode(self._sslObj.read(BLOCK_SIZE),'utf-8').encode(ENCODING, 'replace') ++ data_in = unicode(self._sslObj.recv(BLOCK_SIZE),'utf-8').encode(ENCODING, 'replace') + + elif self._connection == STDIO: + ## Hope this dont buffer ! +@@ -428,8 +428,7 @@ + if self._connection == TCP: + reader = self._sock + elif self._connection == TCP_SSL: +- #reader = self._sslObj +- reader = self._sock ++ reader = self._sslObj + elif self._connection == STDIO: + reader = sys.stdin + else: +@@ -498,8 +497,8 @@ + try: + self.DEBUG("Attempting to create ssl socket") + self._sslObj = socket.ssl( self._sock, None, None ) +- self._sslIssuer = self._sslObj.issuer() +- self._sslServer = self._sslObj.server() ++ self._sslIssuer = self._sslSock.issuer() ++ self._sslServer = self._sslSock.server() + except: + self.DEBUG("Socket Error: No SSL Support") + raise error("No SSL Support") --- jabber.py-0.5.0.orig/patches/old/20xmlstream.py_parser_stack_v0.3.1.diff +++ jabber.py-0.5.0/patches/old/20xmlstream.py_parser_stack_v0.3.1.diff @@ -0,0 +1,39 @@ +--- /usr/lib/python2.2/site-packages/xmlstream.py Sat Jun 1 15:45:09 2002 ++++ xmlstream.py Tue Jun 4 14:59:15 2002 +@@ -260,12 +260,8 @@ + id=None, + connection=TCP + ): +- +- +- self._parser = xml.parsers.expat.ParserCreate(namespace_separator=' ') +- self._parser.StartElementHandler = self._unknown_starttag +- self._parser.EndElementHandler = self._unknown_endtag +- self._parser.CharacterDataHandler = self._handle_data ++ ++ self._setParser() + + self._host = host + self._port = port +@@ -297,6 +293,12 @@ + else: + self._logFH = None + ++ def _setParser(self): ++ self._parser = xml.parsers.expat.ParserCreate(namespace_separator=' ') ++ self._parser.StartElementHandler = self._unknown_starttag ++ self._parser.EndElementHandler = self._unknown_endtag ++ self._parser.CharacterDataHandler = self._handle_data ++ + def DEBUG(self,txt): + if self._debug: + sys.stderr.write("DEBUG: %s\n" % txt) +@@ -366,6 +368,8 @@ + """Reads incoming data. Called by process() so nonblocking""" + data = u'' + data_in = u'' ++ self._setParser() ++ + if self._connection == TCP: + data_in = data_in + \ + unicode(self._sock.recv(BLOCK_SIZE),'utf-8').encode(ENCODING, --- jabber.py-0.5.0.orig/patches/old/21xmlstream.py_XMLunescape_v0.3.1.diff +++ jabber.py-0.5.0/patches/old/21xmlstream.py_XMLunescape_v0.3.1.diff @@ -0,0 +1,14 @@ +--- /usr/lib/python2.1/site-packages/xmlstream.py Sat Jun 8 13:58:40 2002 ++++ xmlstream.py Sun Jun 9 12:34:11 2002 +@@ -61,9 +61,9 @@ + + def XMLunescape(txt): + "Unescape XML entities" +- txt = replace(txt, "&", "&") +- txt = replace(txt, "<", "<") + txt = replace(txt, ">", ">") ++ txt = replace(txt, "<", "<") ++ txt = replace(txt, "&", "&") + return txt + + class error: --- jabber.py-0.5.0.orig/patches/old/22xmlstream.py_OfflineMEssages_v0.3.1.diff +++ jabber.py-0.5.0/patches/old/22xmlstream.py_OfflineMEssages_v0.3.1.diff @@ -0,0 +1,62 @@ +diff -Naur old/xmlstream.py new/xmlstream.py +--- old/xmlstream.py Wed Sep 18 14:48:04 2002 ++++ new/xmlstream.py Fri Oct 25 13:38:05 2002 +@@ -263,6 +263,7 @@ + + self._setParser() + ++ self.read_buffer='' + self._host = host + self._port = port + self._namespace = namespace +@@ -370,7 +371,9 @@ + data_in = u'' + self._setParser() + +- if self._connection == TCP: ++ if self.read_buffer and self.read_buffer[-1:]=='>': ++ pass ++ elif self._connection == TCP: + data_in = data_in + \ + unicode(self._sock.recv(BLOCK_SIZE),'utf-8').encode(ENCODING, + 'replace') +@@ -381,7 +384,7 @@ + data_in = unicode(self._sock.recv(BLOCK_SIZE),'utf-8').encode( + ENCODING, 'replace') + +- if self._connection == TCP_SSL: ++ elif self._connection == TCP_SSL: + data_in = data_in + \ + unicode(self._sslObj.recv(BLOCK_SIZE),'utf-8').encode(ENCODING,'replace') + while data_in: +@@ -405,6 +408,20 @@ + + self.DEBUG("got data %s" % data ) + self.log(data, 'RECV:') ++ self.read_buffer+=data ++ tag1='')] ++ tag2=' def setQueryNode(self, val): --- jabber.py-0.5.0.orig/patches/old/51jabber.py_Client.auth_v0.3.1.diff +++ jabber.py-0.5.0/patches/old/51jabber.py_Client.auth_v0.3.1.diff @@ -0,0 +1,15 @@ +--- /usr/lib/python2.1/site-packages/jabber.py Sat Jun 8 13:58:40 2002 ++++ jabber.py Sat Jun 8 15:28:36 2002 +@@ -477,7 +477,11 @@ + q.insertTag('username').insertData(username) + self.send(auth_get_iq) + +- auth_ret_node = self.waitForResponse("auth-get").asNode() ++ auth_response = self.waitForResponse("auth-get") ++ if auth_response is not None: ++ auth_ret_node = auth_response.asNode() ++ else: ++ return False + auth_ret_query = auth_ret_node.getTag('query') + self.DEBUG("auth-get node arrived!") + --- jabber.py-0.5.0.orig/patches/unused/AlexeyNezhdanov/__str___v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/AlexeyNezhdanov/__str___v0.3.1.diff @@ -0,0 +1,36 @@ +--- xmlstream.py.orig 2002-12-24 21:54:28.000000000 +0100 ++++ xmlstream.py 2002-12-24 22:35:41.000000000 +0100 +@@ -161,10 +161,10 @@ + def __str__(self): + return self._xmlnode2str() + +- def _xmlnode2str(self, parent=None): ++ def _xmlnode2str(self, parent=None, indent=''): + """Returns an xml ( string ) representation of the node + and it children""" +- s = "<" + self.name ++ s = indent + "<" + self.name + if self.namespace: + if parent and parent.namespace != self.namespace: + s = s + " xmlns = '%s' " % self.namespace +@@ -174,12 +174,18 @@ + s = s + ">" + cnt = 0 + if self.kids != None: ++ s+='\n' + for a in self.kids: + if (len(self.data)-1) >= cnt: s = s + XMLescape(self.data[cnt]) +- s = s + a._xmlnode2str(parent=self) ++ s = s + a._xmlnode2str(parent=self,indent=indent+' ') + cnt=cnt+1 + if (len(self.data)-1) >= cnt: s = s + XMLescape(self.data[cnt]) +- s = s + "" ++ if self.kids != None: ++ s += indent ++ if s[-1:]=='>': ++ s = s[:-1]+'/>\n' ++ else: ++ s = s + "\n" + return s + + def getTag(self, name): --- jabber.py-0.5.0.orig/patches/unused/AlexeyNezhdanov/parse_offline_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/AlexeyNezhdanov/parse_offline_v0.3.1.diff @@ -0,0 +1,16 @@ +diff -Nur deb/xmlstream.py parse_offline/xmlstream.py +--- deb/xmlstream.py Tue Oct 29 08:45:55 2002 ++++ parse_offline/xmlstream.py Wed Oct 30 11:19:27 2002 +@@ -405,7 +405,11 @@ + + self.DEBUG("got data %s" % data ) + self.log(data, 'RECV:') +- self._parser.Parse(data) ++ if data[:5]<>'''+data+'').getDom().kids: ++ self.dispatch(i) ++ else: ++ self._parser.Parse(data) + return data + + def write(self,data_out=u''): --- jabber.py-0.5.0.orig/patches/unused/AlexeyNezhdanov/proper_utf-8_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/AlexeyNezhdanov/proper_utf-8_v0.3.1.diff @@ -0,0 +1,12 @@ +diff -Nur deb/xmlstream.py proper_utf-8/xmlstream.py +--- deb/xmlstream.py Tue Oct 29 08:45:55 2002 ++++ proper_utf-8/xmlstream.py Wed Oct 30 11:33:37 2002 +@@ -207,7 +207,7 @@ + """builds a 'minidom' from data parsed to it. Primarily for insertXML + method of Node""" + def __init__(self,data): +- self._parser = xml.parsers.expat.ParserCreate(namespace_separator=' ') ++ self._parser = xml.parsers.expat.ParserCreate(ENCODING,namespace_separator=' ') + self._parser.StartElementHandler = self.unknown_starttag + self._parser.EndElementHandler = self.unknown_endtag + self._parser.CharacterDataHandler = self.handle_data --- jabber.py-0.5.0.orig/patches/unused/AlexeyNezhdanov/whole_ip_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/AlexeyNezhdanov/whole_ip_v0.3.1.diff @@ -0,0 +1,63 @@ +diff -Nur deb/xmlstream.py whole_ip/xmlstream.py +--- deb/xmlstream.py Mon Oct 28 19:38:03 2002 ++++ whole_ip/xmlstream.py Tue Oct 29 08:35:21 2002 +@@ -32,7 +32,7 @@ + + import xmllib, time, sys, re, site, socket + from select import select +-from string import split,find,replace,join ++from string import split,find,replace,join,strip + import xml.parsers.expat + + VERSION = 0.2 +@@ -370,39 +370,17 @@ + data_in = u'' + self._setParser() + +- if self._connection == TCP: +- data_in = data_in + \ +- unicode(self._sock.recv(BLOCK_SIZE),'utf-8').encode(ENCODING, +- 'replace') +- while data_in: +- data = data + data_in +- if len(data_in) != BLOCK_SIZE: +- break +- data_in = unicode(self._sock.recv(BLOCK_SIZE),'utf-8').encode( +- ENCODING, 'replace') +- +- if self._connection == TCP_SSL: +- data_in = data_in + \ +- unicode(self._sslObj.recv(BLOCK_SIZE),'utf-8').encode(ENCODING,'replace') +- while data_in: +- data = data + data_in +- if len(data_in) != BLOCK_SIZE: +- break +- data_in = unicode(self._sslObj.recv(BLOCK_SIZE),'utf-8').encode(ENCODING, 'replace') +- +- elif self._connection == STDIO: +- ## Hope this dont buffer ! +- data_in = data_in + unicode(sys.stdin.read(1024),'utf-8').encode( +- ENCODING, 'replace') +- while data_in: +- data = data + data_in +- if len(data_in) != 1024: +- break +- data_in = unicode(sys.stdin.read(1024),'utf-8').encode( +- ENCODING, 'replace') +- else: +- pass # should never get here +- ++ if self._connection == TCP: readfunc=self._sock.recv ++ elif self._connection == TCP_SSL: readfunc=self._sslObj.recv ++ elif self._connection == STDIO: readfunc=sys.stdin.read ## Hope this dont buffer ! ++ else: return '' # should never get here ++ data_in=readfunc(BLOCK_SIZE) ++ data=data_in ++ while len(data_in)==BLOCK_SIZE or strip(data)[-1:]<>'>': ++ data_in=readfunc(BLOCK_SIZE) ++ data+=data_in ++ data=unicode(data,'utf-8').encode(ENCODING,'replace') ++ + self.DEBUG("got data %s" % data ) + self.log(data, 'RECV:') + self._parser.Parse(data) --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/debug_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/debug_v0.3.1.diff @@ -0,0 +1,22 @@ +--- diffed/x-readwrite 2003-01-13 00:22:25.000000000 +0100 ++++ xmlstream.py 2003-01-13 00:23:07.000000000 +0100 +@@ -308,7 +308,18 @@ + + def DEBUG(self,txt): + if self._debug: +- sys.stderr.write("DEBUG: %s\n" % txt) ++ try: ++ sys.stderr.write("DEBUG: %s\n" % txt) ++ except: ++ # unicode strikes again ;) ++ s=u'' ++ for i in range(len(txt)): ++ if ord(txt[i]) < 128: ++ c = txt[i] ++ else: ++ c = '?' ++ s=s+c ++ sys.stderr.write("DEBUG: %s\n" % s ) + + def getSocket(self): + return self._sock --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/getsetList_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/getsetList_v0.3.1.diff @@ -0,0 +1,52 @@ +--- diffed/timeout 2003-01-12 22:14:14.000000000 +0100 ++++ jabber.py 2003-01-12 22:12:28.000000000 +0100 +@@ -1142,25 +1142,39 @@ + err.putAttr('code',str(code)) + + +- def getQuery(self): +- "returns the query namespace" +- try: return self._node.getTag('query').namespace ++ def _getTag(self,tag): ++ try: return self._node.getTag(tag).namespace + except: return None + +- +- def setQuery(self,namespace): +- """Sets a query's namespace, and inserts a query tag if +- one doesn't already exist. The resulting query tag +- is returned as the function result.""" +- q = self._node.getTag('query') ++ def _setTag(self,tag,namespace): ++ q = self._node.getTag(tag) + if q: + q.namespace = namespace + else: +- q = self._node.insertTag('query') ++ q = self._node.insertTag(tag) + q.setNamespace(namespace) + return q + + ++ def getList(self): ++ "returns the list namespace" ++ return self._getTag('list') ++ ++ def setList(self,namespace): ++ return self._setTag('list',namespace) ++ ++ ++ def getQuery(self): ++ "returns the query namespace" ++ return self._getTag('query') ++ ++ def setQuery(self,namespace): ++ """Sets a query's namespace, and inserts a query tag if ++ one doesn't already exist. The resulting query tag ++ is returned as the function result.""" ++ return self._setTag('query',namespace) ++ ++ + def setQueryPayload(self, payload): + """Sets a Iq's query payload. 'payload' can be either a Node + structure or a valid xml document. The query tag is automatically --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/indention_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/indention_v0.3.1.diff @@ -0,0 +1,739 @@ +--- /home/jaclu/download/jabber/jabber-cvs-1.29.py 2003-01-12 20:10:51.000000000 +0100 ++++ jabber.py 2003-01-12 20:38:57.000000000 +0100 +@@ -198,62 +198,62 @@ + + def setMessageHandler(self, func, type='default', chainOutput=False): + """Sets the callback func for receiving messages. +- Multiple callback functions can be set which are called in +- succession. A type attribute can also be optionally passed so the +- callback is only called when a message of this type is received. ++ Multiple callback functions can be set which are called in ++ succession. A type attribute can also be optionally passed so the ++ callback is only called when a message of this type is received. + +- If 'chainOutput' is set to False (the default), the given function +- should be defined as follows: ++ If 'chainOutput' is set to False (the default), the given function ++ should be defined as follows: + +- def myMsgCallback(c, msg) ++ def myMsgCallback(c, msg) + +- Where the first parameter is the Client object, and the second +- parameter is the Message object representing the message which was +- received. ++ Where the first parameter is the Client object, and the second ++ parameter is the Message object representing the message which was ++ received. + +- If 'chainOutput' is set to True, the output from the various message +- handler functions will be chained together. In this case, the given +- callback function should be defined like this: ++ If 'chainOutput' is set to True, the output from the various message ++ handler functions will be chained together. In this case, the given ++ callback function should be defined like this: + +- def myMsgCallback(c, msg, output) ++ def myMsgCallback(c, msg, output) + +- Where 'output' is the value returned by the previous message +- callback function. For the first callback routine, 'output' will be +- set to an empty string. ++ Where 'output' is the value returned by the previous message ++ callback function. For the first callback routine, 'output' will be ++ set to an empty string. + """ + self.msg_hdlrs.append({ type : { 'cb' : func, +- 'chain' : chainOutput} }) ++ 'chain' : chainOutput} }) + + + def setPresenceHandler(self, func, type='default', chainOutput=False): + """Sets the callback func for receiving presence. +- Multiple callback functions can be set which are called in +- succession. A type attribute can also be optionally passed so the +- callback is only called when a presence of this type is received. ++ Multiple callback functions can be set which are called in ++ succession. A type attribute can also be optionally passed so the ++ callback is only called when a presence of this type is received. + +- If 'chainOutput' is set to False (the default), the given function +- should be defined as follows: ++ If 'chainOutput' is set to False (the default), the given function ++ should be defined as follows: + +- def myPrCallback(c, p) ++ def myPrCallback(c, p) + +- Where the first parameter is the Client object, and the second +- parameter is the Presence object representing the presence packet +- which was received. ++ Where the first parameter is the Client object, and the second ++ parameter is the Presence object representing the presence packet ++ which was received. + +- If 'chainOutput' is set to True, the output from the various +- presence handler functions will be chained together. In this case, +- the given callback function should be defined like this: ++ If 'chainOutput' is set to True, the output from the various ++ presence handler functions will be chained together. In this case, ++ the given callback function should be defined like this: + +- def myPrCallback(c, p, output) ++ def myPrCallback(c, p, output) + +- Where 'output' is the value returned by the previous presence +- callback function. For the first callback routine, 'output' will be +- set to an empty string. ++ Where 'output' is the value returned by the previous presence ++ callback function. For the first callback routine, 'output' will be ++ set to an empty string. + """ + ## self.pres_hdlr = func + + self.pres_hdlrs.append({ type : { 'cb' : func, +- 'chain' : chainOutput} }) ++ 'chain' : chainOutput} }) + + + def setIqHandler(self, func, type='default', ns='default'): +@@ -263,25 +263,25 @@ + can also be set so set functions are only called for + iq elements with these properties. + +- The given function should have two parameters, like this: ++ The given function should have two parameters, like this: + +- def myIQCallback(c, iq) ++ def myIQCallback(c, iq) + +- The first parameter will be set to the Client object, and the second +- parameter will be set to the Iq object representing the IQ packet +- which was received. ++ The first parameter will be set to the Client object, and the second ++ parameter will be set to the Iq object representing the IQ packet ++ which was received. + """ + self.iq_hdlrs.append({ type : { ns : func } }) + + + def setDisconnectHandler(self, func): + """Set the callback for a disconnect. +- The given function will be called with a single parameter (the +- connection object) when the connection is broken unexpectedly (eg, +- in response to sending badly formed XML). self.lastErr and +- self.lastErrCode will be set to the error which caused the +- disconnection, if any. +- """ ++ The given function will be called with a single parameter (the ++ connection object) when the connection is broken unexpectedly (eg, ++ in response to sending badly formed XML). self.lastErr and ++ self.lastErrCode will be set to the error which caused the ++ disconnection, if any. ++ """ + self.disconnect_hdlr = func + + +@@ -289,18 +289,18 @@ + """Called when a message protocol element is received - can be + overidden. """ + output = '' +- type = msg_obj.getType() ++ type = msg_obj.getType() + for dicts in self.msg_hdlrs: + if dicts.has_key(type): +- if dicts[type]['chain']: +- output = dicts[type]['cb'](self, msg_obj, output) +- else: +- dicts[type]['cb'](self, msg_obj) ++ if dicts[type]['chain']: ++ output = dicts[type]['cb'](self, msg_obj, output) ++ else: ++ dicts[type]['cb'](self, msg_obj) + elif dicts.has_key('default'): +- if dicts['default']['chain']: +- output = dicts['default']['cb'](self, msg_obj, output) +- else: +- dicts['default']['cb'](self, msg_obj) ++ if dicts['default']['chain']: ++ output = dicts['default']['cb'](self, msg_obj, output) ++ else: ++ dicts['default']['cb'](self, msg_obj) + else: pass + + +@@ -308,18 +308,18 @@ + """Called when a presence protocol element is received - can be + overidden. """ + output = '' +- type = pres_obj.getType() ++ type = pres_obj.getType() + for dicts in self.pres_hdlrs: + if dicts.has_key(type): +- if dicts[type]['chain']: +- output = dicts[type]['cb'](self, pres_obj, output) +- else: +- dicts[type]['cb'](self, pres_obj) ++ if dicts[type]['chain']: ++ output = dicts[type]['cb'](self, pres_obj, output) ++ else: ++ dicts[type]['cb'](self, pres_obj) + elif dicts.has_key('default'): +- if dicts['default']['chain']: +- output = dicts['default']['cb'](self, pres_obj, output) +- else: +- dicts['default']['cb'](self, pres_obj) ++ if dicts['default']['chain']: ++ output = dicts['default']['cb'](self, pres_obj, output) ++ else: ++ dicts['default']['cb'](self, pres_obj) + else: pass + + +@@ -346,11 +346,11 @@ + def waitForResponse(self, ID, timeout=0): + """Blocks untils a protocol element with the given id is received. + If an error is received, waitForResponse returns None and +- self.lastErr and self.lastErrCode is set to the received error. If +- the operation times out (which only happens if a timeout value is +- given), waitForResponse will return None and self.lastErr will be +- set to "Timeout". """ +- ID = str(ID) ++ self.lastErr and self.lastErrCode is set to the received error. If ++ the operation times out (which only happens if a timeout value is ++ given), waitForResponse will return None and self.lastErr will be ++ set to "Timeout". """ ++ ID = str(ID) + self._expected[ID] = None + then = time.time() + has_timed_out = False +@@ -377,7 +377,7 @@ + def SendAndWaitForResponse(self, obj, ID=None): + """Sends a protocol element object and blocks until a response with + the same ID is received. The received protocol object is returned +- as the function result. """ ++ as the function result. """ + if ID is None : + ID = obj.getID() + if ID is None: +@@ -495,17 +495,17 @@ + sub = item.getAttr('subscription') + ask = item.getAttr('ask') + +- groups = [] +- for group in item.getTags("group"): +- groups.append(group.getData()) ++ groups = [] ++ for group in item.getTags("group"): ++ groups.append(group.getData()) + + if jid: + if sub == 'remove' or sub == 'none': + self._roster._remove(jid) + else: + self._roster._set(jid=jid, name=name, +- groups=groups, sub=sub, +- ask=ask) ++ groups=groups, sub=sub, ++ ask=ask) + else: + self.DEBUG("roster - jid not defined ?") + +@@ -544,19 +544,19 @@ + provided by the server. + Supports plain text, digest and zero-k authentication. + +- Returns True if the login was successful, False otherwise. +- """ ++ Returns True if the login was successful, False otherwise. ++ """ + auth_get_iq = Iq(type='get') + auth_get_iq.setID('auth-get') + q = auth_get_iq.setQuery('jabber:iq:auth') + q.insertTag('username').insertData(username) + self.send(auth_get_iq) + +- auth_response = self.waitForResponse("auth-get") +- if auth_response == None: +- return False # Error +- else: +- auth_ret_node = auth_response.asNode() ++ auth_response = self.waitForResponse("auth-get") ++ if auth_response == None: ++ return False # Error ++ else: ++ auth_ret_node = auth_response.asNode() + + auth_ret_query = auth_ret_node.getTag('query') + self.DEBUG("auth-get node arrived!") +@@ -615,38 +615,38 @@ + + def getRoster(self): + """Returns the current Roster() class instance. Does +- not contact the server.""" ++ not contact the server.""" + return self._roster + + + def addRosterItem(self, jid): +- """ Send off a request to subscribe to the given jid. +- """ +- self.send(Presence(to=jid, type="subscribe")) ++ """ Send off a request to subscribe to the given jid. ++ """ ++ self.send(Presence(to=jid, type="subscribe")) + + + def updateRosterItem(self, jid, name=None, groups=None): +- """ Update the information stored in the roster about a roster item. ++ """ Update the information stored in the roster about a roster item. + +- 'jid' is the Jabber ID of the roster entry; 'name' is the value to +- set the entry's name to, and 'groups' is a list of groups to which +- this roster entry can belong. If either 'name' or 'groups' is not +- specified, that value is not updated in the roster. +- """ +- iq = Iq(type='set') +- item = iq.setQuery('jabber:iq:roster').insertTag('item') +- item.putAtrr('jid', str(jid)) +- if name != None: item.putAtrr('name', name) +- if groups != None: +- for group in groups: +- item.insertTag('group').insertData(group) +- dummy = self.sendAndWaitForResponse(iq) # Do we need to wait?? ++ 'jid' is the Jabber ID of the roster entry; 'name' is the value to ++ set the entry's name to, and 'groups' is a list of groups to which ++ this roster entry can belong. If either 'name' or 'groups' is not ++ specified, that value is not updated in the roster. ++ """ ++ iq = Iq(type='set') ++ item = iq.setQuery('jabber:iq:roster').insertTag('item') ++ item.putAtrr('jid', str(jid)) ++ if name != None: item.putAtrr('name', name) ++ if groups != None: ++ for group in groups: ++ item.insertTag('group').insertData(group) ++ dummy = self.sendAndWaitForResponse(iq) # Do we need to wait?? + + + def removeRosterItem(self,jid): + """Removes an item with Jabber ID jid from both the +- server's roster and the local internal Roster() +- instance""" ++ server's roster and the local internal Roster() ++ instance""" + rost_iq = Iq(type='set') + q = rost_iq.setQuery('jabber:iq:roster').insertTag('item') + q.putAtrr('jid', str(jid)) +@@ -672,9 +672,9 @@ + + def getRegInfo(self): + """Returns a dictionary of fields requested by the server for a +- registration attempt. Each dictionary entry maps from the name of +- the field to the field's current value (either as returned by the +- server or set programmatically by calling self.setRegInfo(). """ ++ registration attempt. Each dictionary entry maps from the name of ++ the field to the field's current value (either as returned by the ++ server or set programmatically by calling self.setRegInfo(). """ + return self._reg_info + + +@@ -696,42 +696,42 @@ + + + def deregister(self, agent=None): +- """ Send off a request to deregister with the server or with the given +- agent. Returns True if successful, else False. ++ """ Send off a request to deregister with the server or with the given ++ agent. Returns True if successful, else False. + +- Note that you must be authorised before attempting to deregister. +- """ ++ Note that you must be authorised before attempting to deregister. ++ """ + if agent: agent = agent + '.' + if agent is None: agent = '' +- q = self.requestRegInfo() +- kids = q.getQueryPayload() +- keyTag = kids.getTag("key") +- +- iq = Iq(to=agent+self._host, type="set") +- iq.setQuery("jabber:iq:register") +- iq.setQueryNode("") +- q = iq.getQueryNode() +- if keyTag != None: +- q.insertXML("" + keyTag.getData() + "") +- q.insertXML("") +- +- result = self.SendAndWaitForResponse(iq) +- +- if result == None: +- return False +- elif result.getType() == "result": +- return True +- else: +- return False ++ q = self.requestRegInfo() ++ kids = q.getQueryPayload() ++ keyTag = kids.getTag("key") ++ ++ iq = Iq(to=agent+self._host, type="set") ++ iq.setQuery("jabber:iq:register") ++ iq.setQueryNode("") ++ q = iq.getQueryNode() ++ if keyTag != None: ++ q.insertXML("" + keyTag.getData() + "") ++ q.insertXML("") ++ ++ result = self.SendAndWaitForResponse(iq) ++ ++ if result == None: ++ return False ++ elif result.getType() == "result": ++ return True ++ else: ++ return False + + ## Agent helper funcs ## + + def requestAgents(self): + """Requests a list of available agents. Returns a dictionary +- containing information about each agent; each entry in the +- dictionary maps the agent's JID to a dictionary of attributes +- describing what that agent can do (as returned by the +- jabber:iq:agents query).""" ++ containing information about each agent; each entry in the ++ dictionary maps the agent's JID to a dictionary of attributes ++ describing what that agent can do (as returned by the ++ jabber:iq:agents query).""" + self._agents = {} + agents_iq = Iq(type='get') + agents_iq.setQuery('jabber:iq:agents') +@@ -804,7 +804,7 @@ + + def getX(self,index=None): + """Returns the x namespace, optionally passed an index if there are +- multiple tags.""" ++ multiple tags.""" + ## TODO make it work for multiple x nodes + try: return self._node.getTag('x').namespace + except: return None +@@ -825,7 +825,7 @@ + + def setXPayload(self, payload): + """Sets the Child of an 'x' tag. Can be a Node instance or an +- XML document""" ++ XML document""" + x = self._node.insertTag('x') + + if type(payload) == type('') or type(payload) == type(u''): +@@ -884,9 +884,9 @@ + + def fromTo(self): + """Swaps the element's from and to attributes. +- Note that this is only useful for writing components; if you are +- writing a Jabber client you shouldn't use this, because the Jabber +- server will set the 'from' field automatically.""" ++ Note that this is only useful for writing components; if you are ++ writing a Jabber client you shouldn't use this, because the Jabber ++ server will set the 'from' field automatically.""" + tmp = self.getTo() + self.setTo(self.getFrom()) + self.setFrom(tmp) +@@ -976,8 +976,8 @@ + if err: + err.putData(val) + else: +- err = self._node.insertTag('error') +- err.putData(val) ++ err = self._node.insertTag('error') ++ err.putData(val) + err.putAttr('code',str(code)) + + +@@ -988,8 +988,8 @@ + + def build_reply(self, reply_txt=''): + """Returns a new Message object as a reply to itself. +- The reply message has the 'to', 'type' and 'thread' attributes +- automatically set.""" ++ The reply message has the 'to', 'type' and 'thread' attributes ++ automatically set.""" + m = Message(to=self.getFrom(), body=reply_txt) + if not self.getType() == None: + m.setType(self.getType()) +@@ -1101,7 +1101,7 @@ + def setQuery(self,namespace): + """Sets a query's namespace, and inserts a query tag if + one doesn't already exist. The resulting query tag +- is returned as the function result.""" ++ is returned as the function result.""" + q = self._node.getTag('query') + if q: + q.namespace = namespace +@@ -1156,7 +1156,7 @@ + item availability.""" + def __init__(self): + self._data = {} +- self._listener = None ++ self._listener = None + ## unused for now ... ## + self._lut = { 'both':RS_SUB_BOTH, + 'from':RS_SUB_FROM, +@@ -1164,40 +1164,40 @@ + + + def setListener(self, listener): +- """ Set a listener function to be called whenever the roster changes. ++ """ Set a listener function to be called whenever the roster changes. + +- The given function will be called whenever the contents of the +- roster changes in response to a received or packet. +- The listener function should be defined as follows: +- +- def listener(action, jid, info) +- +- 'action' is a string indicating what type of change has occurred: +- +- "add" A new item has been added to the roster. +- "update" An existing roster item has been updated. +- "remove" A roster entry has been removed. +- +- 'jid' is the Jabber ID (as a string) of the affected roster entry. +- +- 'info' is a dictionary containing the information that has been +- added or updated for this roster entry. This dictionary may +- contain any combination of the following: +- +- "name" The associated name of this roster entry. +- "groups" A list of groups associated with this roster entry. +- "online" The roster entry's "online" value ("online", +- "offline" or "pending"). +- "sub" The roster entry's subscription value ("none", +- "from", "to" or "both"). +- "ask" The roster entry's ask value, if any (None, +- "subscribe", "unsubscribe"). +- "show" The roster entry's show value, if any (None, "away", +- "chat", "dnd", "normal", "xa"). +- "status" The roster entry's current 'status' value, if +- specified. +- """ +- self._listener = listener ++ The given function will be called whenever the contents of the ++ roster changes in response to a received or packet. ++ The listener function should be defined as follows: ++ ++ def listener(action, jid, info) ++ ++ 'action' is a string indicating what type of change has occurred: ++ ++ "add" A new item has been added to the roster. ++ "update" An existing roster item has been updated. ++ "remove" A roster entry has been removed. ++ ++ 'jid' is the Jabber ID (as a string) of the affected roster entry. ++ ++ 'info' is a dictionary containing the information that has been ++ added or updated for this roster entry. This dictionary may ++ contain any combination of the following: ++ ++ "name" The associated name of this roster entry. ++ "groups" A list of groups associated with this roster entry. ++ "online" The roster entry's "online" value ("online", ++ "offline" or "pending"). ++ "sub" The roster entry's subscription value ("none", ++ "from", "to" or "both"). ++ "ask" The roster entry's ask value, if any (None, ++ "subscribe", "unsubscribe"). ++ "show" The roster entry's show value, if any (None, "away", ++ "chat", "dnd", "normal", "xa"). ++ "status" The roster entry's current 'status' value, if ++ specified. ++ """ ++ self._listener = listener + + + def getStatus(self, jid): ## extended +@@ -1218,7 +1218,7 @@ + + def getOnline(self,jid): ## extended + """Returns the 'online' status for a Roster item with the given jid. +- """ ++ """ + jid = str(jid) + if self._data.has_key(jid): + return self._data[jid]['online'] +@@ -1226,9 +1226,9 @@ + + + def getSub(self,jid): +- """Returns the 'subscription' status for a Roster item with the given +- jid.""" +- jid = str(jid) ++ """Returns the 'subscription' status for a Roster item with the given ++ jid.""" ++ jid = str(jid) + if self._data.has_key(jid): + return self._data[jid]['sub'] + return None +@@ -1243,12 +1243,12 @@ + + + def getGroups(self,jid): +- """ Returns the lsit of groups associated with the given roster item. +- """ +- jid = str(jid) +- if self._data.has_key(jid): +- return self._data[jid]['groups'] +- return None ++ """ Returns the lsit of groups associated with the given roster item. ++ """ ++ jid = str(jid) ++ if self._data.has_key(jid): ++ return self._data[jid]['groups'] ++ return None + + + def getAsk(self,jid): +@@ -1261,8 +1261,8 @@ + + def getSummary(self): + """Returns a summary of the roster's contents. The returned value is a +- dictionary mapping the basic (no resource) JIDs to their current +- availability status (online, offline, pending). """ ++ dictionary mapping the basic (no resource) JIDs to their current ++ availability status (online, offline, pending). """ + to_ret = {} + for jid in self._data.keys(): + to_ret[jid] = self._data[jid]['online'] +@@ -1271,7 +1271,7 @@ + + def getJIDs(self): + """Returns a list of JIDs stored within the roster. Each entry in the +- list is a JID object.""" ++ list is a JID object.""" + to_ret = []; + for jid in self._data.keys(): + to_ret.append(JID(jid)) +@@ -1293,28 +1293,28 @@ + + + def _set(self,jid,name,groups,sub,ask): +- # meant to be called by actual iq tag ++ # meant to be called by actual iq tag + """Used internally - private""" + jid = str(jid) # just in case + online = 'offline' + if ask: online = 'pending' + if self._data.has_key(jid): # update it + self._data[jid]['name'] = name +- self._data[jid]['groups'] = groups ++ self._data[jid]['groups'] = groups + self._data[jid]['ask'] = ask + self._data[jid]['sub'] = sub +- if self._listener != None: +- self._listener("update", jid, {'name' : name, +- 'groups' : groups, +- 'sub' : sub, 'ask' : ask}) ++ if self._listener != None: ++ self._listener("update", jid, {'name' : name, ++ 'groups' : groups, ++ 'sub' : sub, 'ask' : ask}) + else: + self._data[jid] = { 'name': name, 'groups' : groups, 'ask': ask, +- 'sub': sub, 'online': online, 'status': None, +- 'show': None} +- if self._listener != None: +- self._listener("add", jid, {'name' : name, 'groups' : groups, +- 'sub' : sub, 'ask' : ask, +- 'online' : online}) ++ 'sub': sub, 'online': online, 'status': None, ++ 'show': None} ++ if self._listener != None: ++ self._listener("add", jid, {'name' : name, 'groups' : groups, ++ 'sub' : sub, 'ask' : ask, ++ 'online' : online}) + + + def _setOnline(self,jid,val): +@@ -1322,14 +1322,14 @@ + jid = str(jid) + if self._data.has_key(jid): + self._data[jid]['online'] = val +- if self._listener != None: +- self._listener("update", jid, {'online' : val}) ++ if self._listener != None: ++ self._listener("update", jid, {'online' : val}) + else: ## fall back + jid_basic = JID(jid).getStripped() + if self._data.has_key(jid_basic): + self._data[jid_basic]['online'] = val +- if self._listener != None: +- self._listener("update", jid_basic, {'online' : val}) ++ if self._listener != None: ++ self._listener("update", jid_basic, {'online' : val}) + + + def _setShow(self,jid,val): +@@ -1337,14 +1337,14 @@ + jid = str(jid) + if self._data.has_key(jid): + self._data[jid]['show'] = val +- if self._listener != None: +- self._listener("update", jid, {'show' : val}) ++ if self._listener != None: ++ self._listener("update", jid, {'show' : val}) + else: ## fall back + jid_basic = JID(jid).getStripped() + if self._data.has_key(jid_basic): + self._data[jid_basic]['show'] = val +- if self._listener != None: +- self._listener("update", jid_basic, {'show' : val}) ++ if self._listener != None: ++ self._listener("update", jid_basic, {'show' : val}) + + + def _setStatus(self,jid,val): +@@ -1352,22 +1352,22 @@ + jid = str(jid) + if self._data.has_key(jid): + self._data[jid]['status'] = val +- if self._listener != None: +- self._listener("update", jid, {'status' : val}) ++ if self._listener != None: ++ self._listener("update", jid, {'status' : val}) + else: ## fall back + jid_basic = JID(jid).getStripped() + if self._data.has_key(jid_basic): + self._data[jid_basic]['status'] = val +- if self._listener != None: +- self._listener("update", jid_basic, {'status' : val}) ++ if self._listener != None: ++ self._listener("update", jid_basic, {'status' : val}) + + + def _remove(self,jid): + """Used internally - private""" + if self._data.has_key(jid): +- del self._data[jid] +- if self._listener != None: +- self._listener("remove", jid, {}) ++ del self._data[jid] ++ if self._listener != None: ++ self._listener("remove", jid, {}) + + ############################################################################# + +@@ -1455,9 +1455,9 @@ + """docs to come soon... """ + def __init__(self, host, port=5222, connection=xmlstream.TCP, + debug=False, log=False, ns='jabber:component:accept'): +- # EJW: Does it make sense to have a default port here? Components, by +- # definition, will use a port different from the standard Jabber client +- # connection port, so the above is misleading... ++ # EJW: Does it make sense to have a default port here? Components, by ++ # definition, will use a port different from the standard Jabber client ++ # connection port, so the above is misleading... + + self._auth_OK = False + --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/namespaces_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/namespaces_v0.3.1.diff @@ -0,0 +1,233 @@ +--- diffed/indented 2003-01-12 20:52:04.000000000 +0100 ++++ diffed/indented-namespaces 2003-01-12 21:48:56.000000000 +0100 +@@ -73,37 +73,81 @@ + False = 0; + True = 1; + +-NS_CLIENT = "jabber:client" +-NS_SERVER = "jabber:server" ++# ++# JANA core namespaces ++# from http://www.jabber.org/jana/namespaces.php as of 2003-01-12 ++# "myname" means that namespace didnt have a name in the jabberd headers ++# ++NS_AGENT = "jabber:iq:agent" ++NS_AGENTS = "jabber:iq:agents" + NS_AUTH = "jabber:iq:auth" ++NS_CLIENT = "jabber:client" ++NS_DELAY = "jabber:x:delay" ++NS_OOB = "jabber:iq:oob" + NS_REGISTER = "jabber:iq:register" + NS_ROSTER = "jabber:iq:roster" +-NS_OFFLINE = "jabber:x:offline" +-NS_AGENT = "jabber:iq:agent" +-NS_AGENTS = "jabber:iq:agents" +-NS_DELAY = "jabber:x:delay" +-NS_VERSION = "jabber:iq:version" ++NS_XROSTER = "jabber:x:roster" # myname ++NS_SERVER = "jabber:server" + NS_TIME = "jabber:iq:time" +-NS_VCARD = "vcard-temp" +-NS_PRIVATE = "jabber:iq:private" +-NS_SEARCH = "jabber:iq:search" +-NS_OOB = "jabber:iq:oob" +-NS_XOOB = "jabber:x:oob" +-NS_ADMIN = "jabber:iq:admin" +-NS_FILTER = "jabber:iq:filter" +-NS_AUTH_0K = "jabber:iq:auth:0k" +-NS_BROWSE = "jabber:iq:browse" +-NS_EVENT = "jabber:x:event" +-NS_CONFERENCE = "jabber:iq:conference" +-NS_SIGNED = "jabber:x:signed" +-NS_ENCRYPTED = "jabber:x:encrypted" +-NS_GATEWAY = "jabber:iq:gateway" +-NS_LAST = "jabber:iq:last" +-NS_ENVELOPE = "jabber:x:envelope" +-NS_EXPIRE = "jabber:x:expire" +-NS_XHTML = "http://www.w3.org/1999/xhtml" +-NS_XDBGINSERT = "jabber:xdb:ginsert" +-NS_XDBNSLIST = "jabber:xdb:nslist" ++NS_VERSION = "jabber:iq:version" ++ ++NS_COMP_ACCEPT = "jabber:component:accept" # myname ++NS_COMP_CONNECT = "jabber:component:connect" # myname ++ ++ ++ ++# ++# JANA JEP namespaces, ordered by JEP ++# from http://www.jabber.org/jana/namespaces.php as of 2003-01-12 ++# all names by jaclu ++# ++_NS_PROTOCOL = "http://jabber.org/protocol" # base for other ++NS_PASS = "jabber:iq:pass" # JEP-0003 ++NS_XDATA = "jabber:x:data" # JEP-0004 ++NS_RPC = "jabber:iq:rpc" # JEP-0009 ++NS_BROWSE = "jabber:iq:browse" # JEP-0011 ++NS_LAST = "jabber:iq:last" #JEP-0012 ++NS_PRIVACY = "jabber:iq:privacy" # JEP-0016 ++NS_XEVENT = "jabber:x:event" # JEP-0022 ++NS_XEXPIRE = "jabber:x:expire" # JEP-0023 ++NS_XENCRYPTED = "jabber:x:encrypted" # JEP-0027 ++NS_XSIGNED = "jabber:x:signed" # JEP-0027 ++NS_P_MUC = _NS_PROTOCOL + "/muc" # JEP-0045 ++NS_VCARD = "vcard-temp" # JEP-0054 ++ ++ ++# ++# Non JANA aproved, ordered by JEP ++# all names by jaclu ++# ++_NS_P_DISCO = _NS_PROTOCOL + "/disco" # base for other ++NS_P_DISC_INFO = _NS_P_DISCO + "#info" # JEP-0030 ++NS_P_DISC_ITEMS = _NS_P_DISCO + "#items" # JEP-0030 ++NS_P_COMMANDS = _NS_PROTOCOL + "/commands" # JEP-0050 ++ ++ ++""" ++ 2002-01-11 jaclu ++ ++ Defined in jabberd/lib/lib.h, but not JANA aproved and not used in jabber.py ++ so commented out, should/could propably be removed... ++ ++ NS_ADMIN = "jabber:iq:admin" ++ NS_AUTH_OK = "jabber:iq:auth:0k" ++ NS_CONFERENCE = "jabber:iq:conference" ++ NS_ENVELOPE = "jabber:x:envelope" ++ NS_FILTER = "jabber:iq:filter" ++ NS_GATEWAY = "jabber:iq:gateway" ++ NS_OFFLINE = "jabber:x:offline" ++ NS_PRIVATE = "jabber:iq:private" ++ NS_SEARCH = "jabber:iq:search" ++ NS_XDBGINSERT = "jabber:xdb:ginsert" ++ NS_XDBNSLIST = "jabber:xdb:nslist" ++ NS_XHTML = "http://www.w3.org/1999/xhtml" ++ NS_XOOB = "jabber:x:oob" ++ NS_COMP_EXECUTE = "jabber:component:execute" # myname ++""" ++ + + ## Possible constants for Roster class .... hmmm ## + RS_SUB_BOTH = 0 +@@ -400,7 +444,7 @@ + def __init__(self, host, port=5222, debug=False, log=False, + connection=xmlstream.TCP ): + +- Connection.__init__(self, host, port,'jabber:client', debug, log, ++ Connection.__init__(self, host, port, NS_CLIENT, debug, log, + connection=connection) + + self._roster = Roster() +@@ -409,7 +453,7 @@ + self._reg_agent = '' + + #xmlstream.Client.__init__(self, host, port, +- # 'jabber:client', debug, log) ++ # NS_CLIENT, debug, log) + + + def connect(self): +@@ -548,7 +592,7 @@ + """ + auth_get_iq = Iq(type='get') + auth_get_iq.setID('auth-get') +- q = auth_get_iq.setQuery('jabber:iq:auth') ++ q = auth_get_iq.setQuery(NS_AUTH) + q.insertTag('username').insertData(username) + self.send(auth_get_iq) + +@@ -564,7 +608,7 @@ + auth_set_iq = Iq(type='set') + auth_set_iq.setID('auth-set') + +- q = auth_set_iq.setQuery('jabber:iq:auth') ++ q = auth_set_iq.setQuery(NS_AUTH) + q.insertTag('username').insertData(username) + q.insertTag('resource').insertData(resource) + +@@ -606,7 +650,7 @@ + """Requests the roster from the server and returns a + Roster() class instance.""" + rost_iq = Iq(type='get') +- rost_iq.setQuery('jabber:iq:roster') ++ rost_iq.setQuery(NS_ROSTER) + self.SendAndWaitForResponse(rost_iq) + self.DEBUG("got roster response") + self.DEBUG("roster -> %s" % str(self._agents)) +@@ -634,7 +678,7 @@ + specified, that value is not updated in the roster. + """ + iq = Iq(type='set') +- item = iq.setQuery('jabber:iq:roster').insertTag('item') ++ item = iq.setQuery(NS_ROSTER).insertTag('item') + item.putAtrr('jid', str(jid)) + if name != None: item.putAtrr('name', name) + if groups != None: +@@ -648,7 +692,7 @@ + server's roster and the local internal Roster() + instance""" + rost_iq = Iq(type='set') +- q = rost_iq.setQuery('jabber:iq:roster').insertTag('item') ++ q = rost_iq.setQuery(NS_ROSTER).insertTag('item') + q.putAtrr('jid', str(jid)) + q.putAtrr('subscription', 'remove') + self.SendAndWaitForResponse(rost_iq) +@@ -664,7 +708,7 @@ + self._reg_info = {} + self.DEBUG("agent -> %s, _host -> %s" % ( agent ,self._host)) + reg_iq = Iq(type='get', to = agent + self._host) +- reg_iq.setQuery('jabber:iq:register') ++ reg_iq.setQuery(NS_REGISTER) + self.DEBUG("got reg response") + self.DEBUG("roster -> %s" % str(self._agents)) + return self.SendAndWaitForResponse(reg_iq) +@@ -689,7 +733,7 @@ + if agent: agent = agent + '.' + if agent is None: agent = '' + reg_iq = Iq(to = agent + self._host, type='set') +- q = reg_iq.setQuery('jabber:iq:register') ++ q = reg_iq.setQuery(NS_REGISTER) + for info in self._reg_info.keys(): + q.insertTag(info).putData(self._reg_info[info]) + return self.SendAndWaitForResponse(reg_iq) +@@ -708,7 +752,7 @@ + keyTag = kids.getTag("key") + + iq = Iq(to=agent+self._host, type="set") +- iq.setQuery("jabber:iq:register") ++ iq.setQuery(NS_REGISTER) + iq.setQueryNode("") + q = iq.getQueryNode() + if keyTag != None: +@@ -731,10 +775,10 @@ + containing information about each agent; each entry in the + dictionary maps the agent's JID to a dictionary of attributes + describing what that agent can do (as returned by the +- jabber:iq:agents query).""" ++ NS_AGENTS query).""" + self._agents = {} + agents_iq = Iq(type='get') +- agents_iq.setQuery('jabber:iq:agents') ++ agents_iq.setQuery(NS_AGENTS) + self.SendAndWaitForResponse(agents_iq) + self.DEBUG("got agents response") + self.DEBUG("agents -> %s" % str(self._agents)) +@@ -1447,14 +1491,14 @@ + + ## component types + +-## Accept jabber:component:accept +-## Connect jabber:component:connect +-## Execute jabber:component:execute ++## Accept NS_COMP_ACCEPT ++## Connect NS_COMP_CONNECT ++## Execute NS_COMP_EXECUTE + + class Component(Connection): + """docs to come soon... """ + def __init__(self, host, port=5222, connection=xmlstream.TCP, +- debug=False, log=False, ns='jabber:component:accept'): ++ debug=False, log=False, ns=NS_COMP_ACCEPT): + # EJW: Does it make sense to have a default port here? Components, by + # definition, will use a port different from the standard Jabber client + # connection port, so the above is misleading... --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/time_stamp_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/time_stamp_v0.3.1.diff @@ -0,0 +1,50 @@ +--- diffed/ustr 2003-01-12 22:44:00.000000000 +0100 ++++ jabber.py 2003-01-12 22:51:01.000000000 +0100 +@@ -893,7 +893,8 @@ + """Returns the x namespace, optionally passed an index if there are + multiple tags.""" + ## TODO make it work for multiple x nodes +- try: return self._node.getTag('x').namespace ++ # jaclu 021231 commented out .namespace to get timestamps working ++ try: return self._node.getTag('x') #.namespace + except: return None + + +@@ -986,8 +987,15 @@ + """Builds on the Protocol class to provide an interface for sending + message protocol elements""" + def __init__(self, to=None, body=None, node=None): ++ self.time_stamp = None + if node: + self._node = node ++ # examine x tag and set timestamp if pressent ++ x = self._node.getTag('x') ++ if x: ++ ts = x.getAttr('stamp') ++ if ts: ++ self.setTimestamp( ts ) + else: + self._node = xmlstream.Node(tag='message') + if to: self.setTo(str(to)) +@@ -1026,8 +1034,7 @@ + + + def getTimestamp(self): +- """Not yet implemented.""" +- pass ++ return self.time_stamp + + + def setBody(self,val): +@@ -1069,8 +1076,9 @@ + + + def setTimestamp(self,val): +- """Not yet implemented.""" +- pass ++ if not val: ++ val = time.strftime( '%Y%m%dT%H:%M:%S', time.gmtime( time.time())) ++ self.time_stamp = val + + + def build_reply(self, reply_txt=''): --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/timeout_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/timeout_v0.3.1.diff @@ -0,0 +1,77 @@ +--- diffed/indented-namespaces 2003-01-12 21:48:56.000000000 +0100 ++++ jabber.py 2003-01-12 22:02:01.000000000 +0100 +@@ -387,38 +387,44 @@ + + ## functions for sending element with ID's ## + +- def waitForResponse(self, ID, timeout=0): ++ def waitForResponse(self, ID, timeout=300): + """Blocks untils a protocol element with the given id is received. + If an error is received, waitForResponse returns None and + self.lastErr and self.lastErrCode is set to the received error. If + the operation times out (which only happens if a timeout value is + given), waitForResponse will return None and self.lastErr will be +- set to "Timeout". """ ++ set to "Timeout". ++ Changed default from timeout=0 to timeout=300 to avoid hangs in ++ scripts and such. ++ If you _really_ want no timeout, just set it to 0""" + ID = str(ID) + self._expected[ID] = None +- then = time.time() + has_timed_out = False +- ## TODO , add a timeout +- while (not self._expected[ID]) or has_timed_out: +- self.DEBUG("waiting on %s" % str(ID)) +- self.process(1) +- if timeout and time.time()-then > timeout: +- has_timed_out = True +- +- if has_timed_out: +- self.lastErr = "Timeout" +- return None +- response = self._expected[ID] +- del self._expected[ID] +- if response.getErrorCode(): +- self.lastErr = response.getError() +- self.lastErrCode = response.getErrorCode() +- return None + +- return response ++ abort_time = time.time() + timeout ++ if timeout: ++ self.DEBUG("waiting with timeout:%s for %s" % (timeout,str(ID))) ++ else: ++ self.DEBUG("waiting for %s" % str(ID)) ++ ++ while (not self._expected[ID]) and not has_timed_out: ++ self.process(0.2) ++ if timeout and (time.time() > abort_time): ++ has_timed_out = True ++ if has_timed_out: ++ self.lastErr = "Timeout" ++ return None ++ response = self._expected[ID] ++ del self._expected[ID] ++ if response.getErrorCode(): ++ self.lastErr = response.getError() ++ self.lastErrCode = response.getErrorCode() ++ return None ++ ++ return response + + +- def SendAndWaitForResponse(self, obj, ID=None): ++ def SendAndWaitForResponse(self, obj, ID=None, timeout=300): + """Sends a protocol element object and blocks until a response with + the same ID is received. The received protocol object is returned + as the function result. """ +@@ -429,7 +435,7 @@ + obj.setID(ID) + ID = str(ID) + self.send(obj) +- return self.waitForResponse(ID) ++ return self.waitForResponse(ID,timeout) + + + def getAnID(self): --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/typo_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/typo_v0.3.1.diff @@ -0,0 +1,13 @@ +--- diffed/timestamps 2003-01-12 22:59:43.000000000 +0100 ++++ jabber.py 2003-01-12 23:00:15.000000000 +0100 +@@ -736,8 +736,8 @@ + instance""" + rost_iq = Iq(type='set') + q = rost_iq.setQuery(NS_ROSTER).insertTag('item') +- q.putAtrr('jid', str(jid)) +- q.putAtrr('subscription', 'remove') ++ q.putAttr('jid', str(jid)) ++ q.putAttr('subscription', 'remove') + self.SendAndWaitForResponse(rost_iq) + return self._roster + --- jabber.py-0.5.0.orig/patches/unused/JacobLundqvist/ustr_v0.3.1.diff +++ jabber.py-0.5.0/patches/unused/JacobLundqvist/ustr_v0.3.1.diff @@ -0,0 +1,62 @@ +--- diffed/getSetList 2003-01-12 22:16:24.000000000 +0100 ++++ jabber.py 2003-01-12 22:38:49.000000000 +0100 +@@ -73,6 +73,9 @@ + False = 0; + True = 1; + ++USTR_ENCODING='iso-8859-1' ++ ++ + # + # JANA core namespaces + # from http://www.jabber.org/jana/namespaces.php as of 2003-01-12 +@@ -163,6 +166,40 @@ + + ############################################################################# + ++def ustr(what, encoding=USTR_ENCODING): ++ """ ++ If sending object is already a unicode str, just ++ return it, otherwise convert it using encoding ++ """ ++ if type(what) == type(u''): ++ r = what ++ else: ++ r = what.__str__() ++ # make sure __str__() didnt return a unicode ++ if type(r) <> type(u''): ++ r = unicode(r,encoding,'replace') ++ return r ++ ++ ++def str(what): ++ """quick and dirty catchall for all the str() usage. ++ ++ The code in this module should really be changed to call ustr() ++ instead of str() unless there is a good reason, ++ but remember all data on the wire are suposed to be unicode, ++ so this piece saves sloppy code ;) ++ ++ str() usage generally tend to break things for everybody that ++ doesnt speek english - and we are quite a few on this planet... ++ ++ If this is just to much to swallow, feel free to comment this out, ++ but please at least make sure that at least Client.send() uses ustr() ++ in that case ++ """ ++ return ustr(what) ++ ++ ++ + class Connection(xmlstream.Client): + """Forms the base for both Client and Component Classes""" + def __init__(self, host, port, namespace, +@@ -480,7 +517,7 @@ + + def send(self, what): + """Sends a jabber protocol element (Node) to the server""" +- xmlstream.Client.write(self,str(what)) ++ xmlstream.Client.write(self,ustr(what)) + + + def sendInitPresence(self): --- jabber.py-0.5.0.orig/patches/unused/README +++ jabber.py-0.5.0/patches/unused/README @@ -0,0 +1,13 @@ +Those directories contain patches from +jabberpy-devel@lists.sourceforge.net or sent to me directly by their +authors. + +I've chosen to not apply them mainly a couple of reasons: + - I've not time to test them properly (so I will test them if future) + - I've judged they are a mere rewrite of original code (I want to keep + original code intact, no need of stylish patches, even if I can like + them) +they may be rejected because of some other reasons, like I dislike them +or I think they do not really fix a bug. + +Each directory has the name of patches author.