66import os
77from distutils .core import setup
88
9+ import sqlparse
10+
911
1012def find_packages (base ):
1113 ret = [base ]
@@ -48,13 +50,13 @@ def find_packages(base):
4850
4951Parsing::
5052
51- >>> sql = 'select * from " someschema"." mytable" where id = 1'
53+ >>> sql = 'select * from someschema. mytable where id = 1'
5254 >>> res = sqlparse.parse(sql)
5355 >>> res
5456 (<Statement 'select...' at 0x9ad08ec>,)
5557 >>> stmt = res[0]
5658 >>> stmt.to_unicode() # converting it back to unicode
57- u'select * from " someschema"." mytable" where id = 1'
59+ u'select * from someschema. mytable where id = 1'
5860 >>> # This is how the internal representation looks like:
5961 >>> stmt.tokens
6062 (<DML 'select' at 0x9b63c34>,
@@ -63,21 +65,25 @@ def find_packages(base):
6365 <Whitespace ' ' at 0x9b63c5c>,
6466 <Keyword 'from' at 0x9b63c84>,
6567 <Whitespace ' ' at 0x9b63cd4>,
66- <Identifier '" somes...' at 0x9b5c62c>,
68+ <Identifier 'somes...' at 0x9b5c62c>,
6769 <Whitespace ' ' at 0x9b63f04>,
6870 <Where 'where ...' at 0x9b5caac>)
6971
7072"""
7173
7274
75+ DOWNLOAD_URL = ('http://python-sqlparse.googlecode.com/files/'
76+ 'sqlparse-%s.tar.gz' % sqlparse .__version__ )
77+
78+
7379setup (
7480 name = 'sqlparse' ,
75- version = '0.1.0' ,
81+ version = sqlparse . __version__ ,
7682 packages = find_packages ('sqlparse' ),
7783 description = 'Non-validating SQL parser' ,
7884 author = 'Andi Albrecht' ,
7985 author_email = 'albrecht.andi@gmail.com' ,
80- download_url = 'http://python-sqlparse.googlecode.com/files/sqlparse-0.1.0.tar.gz' ,
86+ download_url = DOWNLOAD_URL ,
8187 long_description = LONG_DESCRIPTION ,
8288 license = 'BSD' ,
8389 url = 'http://python-sqlparse.googlecode.com/' ,
@@ -87,6 +93,10 @@ def find_packages(base):
8793 'License :: OSI Approved :: BSD License' ,
8894 'Operating System :: OS Independent' ,
8995 'Programming Language :: Python' ,
96+ 'Programming Language :: Python :: 2' ,
97+ 'Programming Language :: Python :: 2.4' ,
98+ 'Programming Language :: Python :: 2.5' ,
99+ 'Programming Language :: Python :: 2.6' ,
90100 'Topic :: Database' ,
91101 'Topic :: Software Development'
92102 ],
0 commit comments