diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2009-04-30 06:21:23 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2009-04-30 06:21:23 +0200 |
| commit | 7670fc3c2304a4b569a42ef13892eea65aac0e21 (patch) | |
| tree | da63b5fbeddb8b1518d69da07880cfff8d6247b6 /extras/appengine/static/sqlformat_client_example.py | |
| parent | 1fd167879df0a65ec2cc2bcf023ca3b45cff8d9c (diff) | |
| download | sqlparse-7670fc3c2304a4b569a42ef13892eea65aac0e21.tar.gz | |
* Provide better error message when example client fails.
* Allow empty output_format setting and use 'sql' then.
Diffstat (limited to 'extras/appengine/static/sqlformat_client_example.py')
| -rw-r--r-- | extras/appengine/static/sqlformat_client_example.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/extras/appengine/static/sqlformat_client_example.py b/extras/appengine/static/sqlformat_client_example.py index 3b3bf0f..e4d1606 100644 --- a/extras/appengine/static/sqlformat_client_example.py +++ b/extras/appengine/static/sqlformat_client_example.py @@ -3,6 +3,9 @@ import urllib import urllib2 +REMOTE_API = 'http://sqlformat.appspot.com/format/' +REMOTE_API = 'http://127.0.0.1:8080/format/' + payload = ( ('data', 'select * from foo join bar on val1 = val2 where id = 123;'), ('format', 'text'), @@ -11,7 +14,7 @@ payload = ( ('n_indents', 2), ) -response = urllib2.urlopen('http://sqlformat.appspot.com/format/', +response = urllib2.urlopen(REMOTE_API, urllib.urlencode(payload)) print response.read() |
