From a9c2f033cdbef3e53f6d48bb5aadb89ed761e579 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 6 Jan 2009 05:13:02 +0000 Subject: 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 --- django/utils/simplejson/tool.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'django/utils/simplejson/tool.py') 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 -- cgit v1.3