diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-01-06 05:13:02 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-01-06 05:13:02 +0000 |
| commit | a9c2f033cdbef3e53f6d48bb5aadb89ed761e579 (patch) | |
| tree | 80c62dcc7f73a9ebcd97433741da11101edd29a3 /django/utils/simplejson/tool.py | |
| parent | 3b489b77429aacd05a66c2158edc4f21209aecb9 (diff) | |
Upgraded included simplejson to 2.0.7.
Also changed importing logic to prefer a system-installed version of
simplejson (unless it's an earlier version that does not contian the C
speedups), then the json module from Python 2.6, then the version
shipped with Django.
Fixed #9266.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/simplejson/tool.py')
| -rw-r--r-- | django/utils/simplejson/tool.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/django/utils/simplejson/tool.py b/django/utils/simplejson/tool.py index d0eb8ad9ee..74401c279a 100644 --- a/django/utils/simplejson/tool.py +++ b/django/utils/simplejson/tool.py @@ -1,23 +1,14 @@ -r""" -Using simplejson from the shell to validate and +r"""Using simplejson from the shell to validate and pretty-print:: - - $ echo '{"json":"obj"}' | python -msimplejson + + $ echo '{"json":"obj"}' | python -msimplejson.tool { "json": "obj" } - $ echo '{ 1.2:3.4}' | python -msimplejson + $ echo '{ 1.2:3.4}' | python -msimplejson.tool Expecting property name: line 1 column 2 (char 2) - -Note that the JSON produced by this module's default settings -is a subset of YAML, so it may be used as a serializer for that as well. """ -import django.utils.simplejson - -# -# Pretty printer: -# curl http://mochikit.com/examples/ajax_tables/domains.json | python -msimplejson.tool -# +from django.utils import simplejson def main(): import sys |
