Show More
@@ -234,11 +234,12 b' def json(obj, paranoid=True):' | |||||
234 | elif isinstance(obj, bytes): |
|
234 | elif isinstance(obj, bytes): | |
235 | return '"%s"' % encoding.jsonescape(obj, paranoid=paranoid) |
|
235 | return '"%s"' % encoding.jsonescape(obj, paranoid=paranoid) | |
236 | elif util.safehasattr(obj, 'keys'): |
|
236 | elif util.safehasattr(obj, 'keys'): | |
237 |
out = ['"%s": %s' % (encoding.jsonescape(k, paranoid=paranoid), |
|
237 | out = ['"%s": %s' % (encoding.jsonescape(k, paranoid=paranoid), | |
|
238 | json(v, paranoid)) | |||
238 | for k, v in sorted(obj.iteritems())] |
|
239 | for k, v in sorted(obj.iteritems())] | |
239 | return '{' + ', '.join(out) + '}' |
|
240 | return '{' + ', '.join(out) + '}' | |
240 | elif util.safehasattr(obj, '__iter__'): |
|
241 | elif util.safehasattr(obj, '__iter__'): | |
241 | out = [json(i) for i in obj] |
|
242 | out = [json(i, paranoid) for i in obj] | |
242 | return '[' + ', '.join(out) + ']' |
|
243 | return '[' + ', '.join(out) + ']' | |
243 | else: |
|
244 | else: | |
244 | raise TypeError('cannot encode type %s' % obj.__class__.__name__) |
|
245 | raise TypeError('cannot encode type %s' % obj.__class__.__name__) |
@@ -739,7 +739,7 b' List of all markers in JSON' | |||||
739 | { |
|
739 | { | |
740 | "date": *, (glob) |
|
740 | "date": *, (glob) | |
741 | "flag": 0, |
|
741 | "flag": 0, | |
742 |
"metadata": {"user": "test |
|
742 | "metadata": {"user": "test <test@example.net>"}, | |
743 | "precnode": "cda648ca50f50482b7055c0b0c4c117bba6733d9", |
|
743 | "precnode": "cda648ca50f50482b7055c0b0c4c117bba6733d9", | |
744 | "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"] |
|
744 | "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"] | |
745 | } |
|
745 | } |
General Comments 0
You need to be logged in to leave comments.
Login now