web: indent the JSON to make it easier for humans to read, but slightly larger

This commit is contained in:
Brian Warner 2007-07-08 00:23:23 -07:00
parent 72fc8c5cb8
commit 0395ad76eb

View File

@ -308,7 +308,7 @@ class FileJSONMetadata(rend.Page):
'uri': file_uri, 'uri': file_uri,
'size': pieces['size'], 'size': pieces['size'],
}) })
return JSONEncoder().encode(data) return JSONEncoder(indent=1).encode(data)
class FileURI(FileJSONMetadata): class FileURI(FileJSONMetadata):
def renderNode(self, filenode): def renderNode(self, filenode):
@ -412,7 +412,7 @@ class DirectoryJSONMetadata(rend.Page):
'uri': node.get_uri(), 'uri': node.get_uri(),
} }
data = ("dirnode", contents) data = ("dirnode", contents)
return JSONEncoder().encode(data) return JSONEncoder(indent=1).encode(data)
d.addCallback(_got) d.addCallback(_got)
return d return d