From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfVoF-0008UJ-MV for qemu-devel@nongnu.org; Fri, 25 Sep 2015 12:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfVoC-0002hh-Ea for qemu-devel@nongnu.org; Fri, 25 Sep 2015 12:25:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfV2T-0005XH-9S for qemu-devel@nongnu.org; Fri, 25 Sep 2015 11:35:57 -0400 References: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> <1443189844-20341-9-git-send-email-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <56056979.1010109@redhat.com> Date: Fri, 25 Sep 2015 09:34:17 -0600 MIME-Version: 1.0 In-Reply-To: <1443189844-20341-9-git-send-email-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BjoFnaJxnqVK8C4gSdiB9pMvfwnskvKb2" Subject: Re: [Qemu-devel] [PATCH 08/36] qapi: add qapi2texi script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: armbru@redhat.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BjoFnaJxnqVK8C4gSdiB9pMvfwnskvKb2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/25/2015 08:03 AM, marcandre.lureau@redhat.com wrote: > From: Marc-Andr=C3=A9 Lureau >=20 > As the name suggests, the qapi2texi script converts JSON QAPI > description into a standalone texi file suitable for different target > formats. >=20 > It parses the following kind of blocks with some little variations: >=20 > ## > # =3D Section > # =3D=3D Subsection > # > # Some text foo with *emphasis* > # 1. with a list > # 2. like that > # > # And some code: > # | <- do this > # | -> get that Backwards; you mean: # | -> send this # | <- get that > # Example: > # > # -> { "execute": "quit" } > # <- { "return": {} } > # but this one is right. I'd love to have this formalized semantics of what you plan to parse documented in docs/qapi-code-gen.txt, as a reference we can point to for new commands that don't comply. > Thanks to the json declaration, it's able to give extra information > about the type of arguments and return value expected. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > scripts/qapi.py | 88 +++++++++++++++- > scripts/qapi2texi.py | 293 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 2 files changed, 379 insertions(+), 2 deletions(-) > create mode 100755 scripts/qapi2texi.py I will forbear the actual review detailed for now, in part because it may need another rebase, but the idea seems nice. But I'll do a quick read-through review: >=20 > diff --git a/scripts/qapi.py b/scripts/qapi.py > index 27894c1..2a9b6e5 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py > @@ -112,6 +112,67 @@ class QAPIExprError(Exception): > "%s:%d: %s" % (self.info['file'], self.info['line'], self.= msg) > =20 > =20 > +class QAPIDoc: Use the new-style class inheritance (as in "class QAPIDoc(object):") > +++ b/scripts/qapi2texi.py > @@ -0,0 +1,293 @@ > +#!/usr/bin/env python > +# QAPI texi generator > +# > +# This work is licensed under the terms of the GNU GPL, version 2. Can we please use GPLv2+ for this file? GPLv2-only is a pain (yes, qapi.py is stuck there unless someone does legwork to see if former contributors don't mind relaxing it, but that doesn't mean we have to repeat the mistake) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --BjoFnaJxnqVK8C4gSdiB9pMvfwnskvKb2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWBWl5AAoJEKeha0olJ0Nq26sIAIt9afZxvDb6NC0kVQmgNIpt zT1CWW8OyItBu5mqK10uDKfsoltFdNGzXvLHqyK6+VorLxhOKsdrfBTp8QjnIpOH Y7el4ZDcBRFbYvd/9P6aAQCMyY6MiiwK2S9kxrHtWTKjxK6PoNtEvsII0Am1KKy9 dFipq8wfGLw9EasFsXVh71+vqQlXE5yLOIAzl+8LU8ZjFk/aP3vUuPFXDSf8pLGG vp87yE91m2IDs3QYiIB+dpcDWPeg91JBzAwjrc6k/p8jg7VszVeJnH20QufzthPQ P2kjn6JgTeJP+k0y11tu0QCVvhdc2/VwGOknTMTUIOjfOu5RglddySg8dcY2+90= =RdUc -----END PGP SIGNATURE----- --BjoFnaJxnqVK8C4gSdiB9pMvfwnskvKb2--