From: Brian Warner Date: Sun, 8 Jul 2007 07:23:23 +0000 (-0700) Subject: web: indent the JSON to make it easier for humans to read, but slightly larger X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/(%5B%5E?a=commitdiff_plain;h=0395ad76eb94fa5f2b28cea92052b4ca83368cd4;p=tahoe-lafs%2Ftahoe-lafs.git web: indent the JSON to make it easier for humans to read, but slightly larger --- diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 187c05d1..ad7ed5a2 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -308,7 +308,7 @@ class FileJSONMetadata(rend.Page): 'uri': file_uri, 'size': pieces['size'], }) - return JSONEncoder().encode(data) + return JSONEncoder(indent=1).encode(data) class FileURI(FileJSONMetadata): def renderNode(self, filenode): @@ -412,7 +412,7 @@ class DirectoryJSONMetadata(rend.Page): 'uri': node.get_uri(), } data = ("dirnode", contents) - return JSONEncoder().encode(data) + return JSONEncoder(indent=1).encode(data) d.addCallback(_got) return d