File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ def extract_definitions(token_list):
2929 idx = token_list .token_index (token )
3030 # grab the next token, this times including whitespace
3131 token = token_list .token_next (idx , skip_ws = False )
32- # split on ","
33- if ( token is not None # = end of statement
34- and token .match (sqlparse .tokens .Punctuation , ',' ) ):
32+ # split on ",", except when on end of statement
33+ if token is not None \
34+ and token .match (sqlparse .tokens .Punctuation , ',' ):
3535 definitions .append (tmp )
3636 tmp = []
3737 idx = token_list .token_index (token )
@@ -44,5 +44,5 @@ def extract_definitions(token_list):
4444columns = extract_definitions (par )
4545
4646for column in columns :
47- print 'NAME: %-12s DEFINITION: %s' % (column [0 ],
48- '' .join (str (t ) for t in column [1 :]))
47+ print ( 'NAME: %-12s DEFINITION: %s' % (column [0 ],
48+ '' .join (str (t ) for t in column [1 :]) ))
Original file line number Diff line number Diff line change @@ -57,4 +57,4 @@ def extract_tables():
5757
5858
5959if __name__ == '__main__' :
60- print 'Tables: %s' % ', ' .join (extract_tables ())
60+ print ( 'Tables: %s' % ', ' .join (extract_tables () ))
Original file line number Diff line number Diff line change 1717
1818
1919def get_version ():
20- """parse __init__.py for version number instead of importing the file
21-
22- see http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
23- """
24- VERSIONFILE = 'sqlparse/__init__.py'
20+ """Parse __init__.py for version number instead of importing the file."""
21+ VERSIONFILE = 'sqlparse/__init__.py'
2522 verstrline = open (VERSIONFILE , "rt" ).read ()
2623 VSRE = r'^__version__ = [\'"]([^\'"]*)[\'"]'
2724 mo = re .search (VSRE , verstrline , re .M )
You can’t perform that action at this time.
0 commit comments