diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2013-01-01 14:35:46 +0100 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2013-01-01 14:35:46 +0100 |
| commit | d298f83c4f9d432d1b170c66d4115addefe0b21a (patch) | |
| tree | 5c5eb94d6b34f0a2637c905e5398960a97ba7bb7 | |
| parent | 3854cdfe8ef3d312f3285b085be7005b132c2eb1 (diff) | |
| download | sqlparse-d298f83c4f9d432d1b170c66d4115addefe0b21a.tar.gz | |
Doc updates.
| -rw-r--r-- | CHANGES | 6 | ||||
| -rw-r--r-- | docs/source/intro.rst | 28 | ||||
| -rw-r--r-- | sqlparse/sql.py | 3 |
3 files changed, 17 insertions, 20 deletions
@@ -1,11 +1,15 @@ Development Version ------------------- +sqlparse is now compatible with Python 3 without any patches. The +Python 3 version is generated during install by 2to3. You'll need +distribute to install sqlparse for Python 3. + Bug Fixes * Fix parsing error with dollar-quoted procedure bodies (issue83). Other - * sqlparse is now compatible with Python 3 without any patches. + * Documentation updates. * py3k fixes (by vthriller). * py3k fixes in setup.py (by Florian Bauer). * setup.py now requires distribute (by Florian Bauer). diff --git a/docs/source/intro.rst b/docs/source/intro.rst index 4f841ba..6ea10e1 100644 --- a/docs/source/intro.rst +++ b/docs/source/intro.rst @@ -1,22 +1,13 @@ Introduction ============ -:mod:`sqlparse` is a non-validating SQL parser for Python. -It provides support for parsing, splitting and formatting SQL statements. -The module is released under the terms of the -`New BSD license <http://www.opensource.org/licenses/bsd-license.php>`_. - -Visit the project page at http://python-sqlparse.googlecode.com for -further information about this project. - Download & Installation ----------------------- -The latest released version can be obtained from the -`downloads page <http://code.google.com/p/python-sqlparse/downloads/list>`_ -on the project's website. To extract the source archive and to install -the module on your system run +The latest released version can be obtained from the `Python Package +Index (PyPI) <http://pypi.python.org/pypi/sqlparse/>`_. To extract the +install the module system-wide run .. code-block:: bash @@ -24,10 +15,11 @@ the module on your system run $ cd python-sqlparse/ $ sudo python setup.py install -Alternatively you can install :mod:`sqlparse` from the -`Python Packge Index <http://pypi.python.org/pypi/sqlparse>`_ with your -favorite tool for installing Python modules. For example when using -`pip <http://pypi.python.org/pypi/pip>`_ run :command:`pip install sqlparse`. +Alternatively you can install :mod:`sqlparse` using :command:`pip`: + +.. code-block:: bas + + $ pip install sqlparse Getting Started @@ -108,9 +100,9 @@ Each object can be converted back to a string at any time: .. code-block:: python - >>> stmt.to_unicode() + >>> unicode(stmt) # str(stmt) for Python 3 u'select * from "someschema"."mytable" where id = 1' - >>> stmt.tokens[-1].to_unicode() # or just the WHERE part + >>> unicode(stmt.tokens[-1]) # or just the WHERE part u'where id = 1' Details of the returned objects are described in :ref:`analyze`. diff --git a/sqlparse/sql.py b/sqlparse/sql.py index 8c8f74c..86deb4e 100644 --- a/sqlparse/sql.py +++ b/sqlparse/sql.py @@ -45,7 +45,8 @@ class Token(object): def to_unicode(self): """Returns a unicode representation of this object. - @deprecated: please use __unicode__() + .. deprecated:: 0.1.5 + Use ``unicode(token)`` (for Python 3: ``str(token)``) instead. """ return unicode(self) |
