summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/tostring/__init__.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-08-05 20:26:41 -0400
committerLance Stout <lancestout@gmail.com>2010-08-05 20:26:41 -0400
commite077204a16c76df4af90ba067e94c31af3d9e372 (patch)
tree96d725f14af0f26f19241984a3d85d4555cf1111 /sleekxmpp/xmlstream/tostring/__init__.py
parent58f77d898f82ab108fa17d562a32c68d3ea35306 (diff)
downloadslixmpp-e077204a16c76df4af90ba067e94c31af3d9e372.tar.gz
slixmpp-e077204a16c76df4af90ba067e94c31af3d9e372.tar.bz2
slixmpp-e077204a16c76df4af90ba067e94c31af3d9e372.tar.xz
slixmpp-e077204a16c76df4af90ba067e94c31af3d9e372.zip
Replaced the ToString class with a tostring function.
The sleekxmpp.xmlstream.tostring and sleekxmpp.xmlstream.tostring26 packages have been merged to sleekxmpp.xmlstream.tostring. The __init__.py file will import the appropriate tostring function depending on the Python version. The setup.py file has been updated with the package changes. ElementBase is now a direct descendent of object and does not subclass ToString. Stanza objects now return their XML contents for __repr__.
Diffstat (limited to 'sleekxmpp/xmlstream/tostring/__init__.py')
-rw-r--r--sleekxmpp/xmlstream/tostring/__init__.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/sleekxmpp/xmlstream/tostring/__init__.py b/sleekxmpp/xmlstream/tostring/__init__.py
index d93fe4ea..5852cba2 100644
--- a/sleekxmpp/xmlstream/tostring/__init__.py
+++ b/sleekxmpp/xmlstream/tostring/__init__.py
@@ -1,14 +1,19 @@
"""
+ SleekXMPP: The Sleek XMPP Library
+ Copyright (C) 2010 Nathanael C. Fritz
+ This file is part of SleekXMPP.
+ See the file LICENSE for copying permission.
"""
import sys
+# Import the correct tostring and xml_escape functions based on the Python
+# version in order to properly handle Unicode.
-# Import the correct ToString class based on the Python version.
if sys.version_info < (3, 0):
- from sleekxmpp.xmlstream.tostring.tostring26 import ToString
+ from sleekxmpp.xmlstream.tostring.tostring26 import tostring, xml_escape
else:
- from sleekxmpp.xmlstream.tostring.tostring import ToString
+ from sleekxmpp.xmlstream.tostring.tostring import tostring, xml_escape
-__all__ = ['ToString']
+__all__ = ['tostring', 'xml_escape']