From 5e736f4b978414c111062ffb220e38eb40765db6 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Fri, 29 Jan 2010 23:57:57 -0800 Subject: [PATCH] fixed setup.py issue with unicode in 3.x --- setup.py | 19 +++++++++++++------ sleekxmpp/plugins/xep_0060.py | 2 +- .../{tostring.py => tostring/__init__.py} | 0 .../{tostring26.py => tostring26/__init__.py} | 0 testall.py | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) rename sleekxmpp/xmlstream/{tostring.py => tostring/__init__.py} (100%) rename sleekxmpp/xmlstream/{tostring26.py => tostring26/__init__.py} (100%) diff --git a/setup.py b/setup.py index 7dbd619..163cb8c 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,18 @@ CLASSIFIERS = [ 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules', ] +packages = [ 'sleekxmpp', + 'sleekxmpp/plugins', + 'sleekxmpp/stanza', + 'sleekxmpp/xmlstream', + 'sleekxmpp/xmlstream/matcher', + 'sleekxmpp/xmlstream/handler' ] + +if sys.version_info < (3, 0): + packages.append('sleekxmpp/xmlstream/tostring26') +else: + packages.append('sleekxmpp/xmlstream/tostring') + setup( name = "sleekxmpp", version = VERSION, @@ -47,12 +59,7 @@ setup( url = 'http://code.google.com/p/sleekxmpp', license = 'GPLv2', platforms = [ 'any' ], - packages = [ 'sleekxmpp', - 'sleekxmpp/plugins', - 'sleekxmpp/stanza', - 'sleekxmpp/xmlstream', - 'sleekxmpp/xmlstream/matcher', - 'sleekxmpp/xmlstream/handler' ], + packages = packages, requires = [ 'tlslite', 'pythondns' ], ) diff --git a/sleekxmpp/plugins/xep_0060.py b/sleekxmpp/plugins/xep_0060.py index 837d0ad..999b819 100644 --- a/sleekxmpp/plugins/xep_0060.py +++ b/sleekxmpp/plugins/xep_0060.py @@ -63,7 +63,7 @@ class xep_0060(base.base_plugin): iq = self.xmpp.makeIqSet(pubsub) iq.attrib['to'] = jid iq.attrib['from'] = self.xmpp.fulljid - id = iq.get('id') + id = iq['id'] result = self.xmpp.send(iq, "" % id) if result is False or result is None or result.get('type') == 'error': return False return True diff --git a/sleekxmpp/xmlstream/tostring.py b/sleekxmpp/xmlstream/tostring/__init__.py similarity index 100% rename from sleekxmpp/xmlstream/tostring.py rename to sleekxmpp/xmlstream/tostring/__init__.py diff --git a/sleekxmpp/xmlstream/tostring26.py b/sleekxmpp/xmlstream/tostring26/__init__.py similarity index 100% rename from sleekxmpp/xmlstream/tostring26.py rename to sleekxmpp/xmlstream/tostring26/__init__.py diff --git a/testall.py b/testall.py index bf5e1a9..bf0b4c7 100644 --- a/testall.py +++ b/testall.py @@ -13,7 +13,7 @@ class testoverall(unittest.TestCase): if sys.version_info < (3,0): self.failUnless(compileall.compile_dir('.' + os.sep + 'sleekxmpp', rx=re.compile('/[.]svn'), quiet=True)) else: - self.failUnless(compileall.compile_dir('.' + os.sep + 'sleekxmpp', rx=re.compile('/[.]svn|26.py'), quiet=True)) + self.failUnless(compileall.compile_dir('.' + os.sep + 'sleekxmpp', rx=re.compile('/[.]svn|.*26\Z'), quiet=True)) def testTabNanny(self): """Invoking the tabnanny"""