From d298f83c4f9d432d1b170c66d4115addefe0b21a Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Tue, 1 Jan 2013 14:35:46 +0100 Subject: Doc updates. --- CHANGES | 6 +++++- docs/source/intro.rst | 28 ++++++++++------------------ sqlparse/sql.py | 3 ++- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/CHANGES b/CHANGES index 3c1893f..928cd2c 100644 --- a/CHANGES +++ b/CHANGES @@ -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 `_. - -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 `_ -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) `_. 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 `_ with your -favorite tool for installing Python modules. For example when using -`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) -- cgit v1.2.1