qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v2 45/47] qapi: New QMP command query-schema


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH RFC v2 45/47] qapi: New QMP command query-schema for QMP schema introspection
Date: Mon, 03 Aug 2015 17:15:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Markus Armbruster <address@hidden> writes:

> Eric Blake <address@hidden> writes:
>
>> On 07/29/2015 03:19 AM, Markus Armbruster wrote:
>>>>> Longest line is a bit over 4KiB for me.
>>>>>
>>>>
>>>> If we break up string literals, at least use some indentation to make it
>>>> obvious that multiple lines merge to a single array entry. For example
>>>> (after patch 47):
>>>>
>>>> ...
>>>>     "{ 'name': ':abr', 'meta-type': 'object', "
>>>>       "'members': [ "
>>>>         "{ 'name': 'device', 'type': ':acg', 'default': null }, "
>>>>         "{ 'name': 'node-name', 'type': ':acg', 'default': null }, "
>>>>         "{ 'name': 'snapshot-file', 'type': ':acg' }, "
>>>>         "{ 'name': 'snapshot-node-name', 'type': ':acg', 'default': null
>>>> }, "
>>>>         "{ 'name': 'format', 'type': ':acg', 'default': null }, "
>>>>         "{ 'name': 'mode', 'type': ':afo', 'default': null } ] }, "
>>>>     "{ 'name': ... "
>>> 
>>> Unconventional indentation, but if it helps the reader...
>>
>> I'm not a stickler about the particular spacing I used, so much as
>> demonstrating an idea.  Pick any indentation you like; I was just
>> demonstrating that some well-chosen line breaks, coupled with visual
>> clues on what belongs together, can help in reading the string literal
>> in the generated file.
>>
>> In fact, doesn't python have a way to pretty-print JSON, and then
>> post-process the pretty-printed string to add C \" escaping?
>
> Interesting idea, definitely worth a doc search.

Module json, new in 2.6 (Oct 2008).  As usual, we're a decade behind:
2.4 (Nov 2004).

> Prettier output can of course be punted to a followup-patch.

I guess it'll have to wait for 2.6.

[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]