]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi: Unify representation of doc section without name
authorMarkus Armbruster <armbru@redhat.com>
Mon, 2 Oct 2017 14:13:37 +0000 (16:13 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 20 Dec 2017 18:18:33 +0000 (19:18 +0100)
We have two representations of sections without a name: the main
section uses name=None, the others name=''.  Standardize on name=None.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-8-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
scripts/qapi.py
scripts/qapi2texi.py
tests/qapi-schema/doc-bad-section.out
tests/qapi-schema/doc-good.out

index 2f2738f5629cfd4ef295e9d1147175bdd3c0dd91..2137067b4862b64736adfb563dd1c90e34134926 100644 (file)
@@ -204,7 +204,7 @@ class QAPIDoc(object):
         self.section = QAPIDoc.ArgSection(name)
         self.args[name] = self.section
 
-    def _start_section(self, name=''):
+    def _start_section(self, name=None):
         if name in ('Returns', 'Since') and self.has_section(name):
             raise QAPIParseError(self.parser,
                                  "Duplicated '%s' section" % name)
index f876d9a174681dd1168883b056a998e5223f17e7..f16fa1ba531419d938b6f54d7ae6966d6e4ac423 100755 (executable)
@@ -184,7 +184,7 @@ def texi_sections(doc):
             # prefer @b over @strong, so txt doesn't translate it to *Foo:*
             body += '\n\n@b{%s:}\n' % section.name
         text = str(section)
-        if section.name.startswith('Example'):
+        if section.name and section.name.startswith('Example'):
             body += texi_example(text)
         else:
             body += texi_format(text)
index 6fce84dd34c18a9fed8af90840aaacbbdfe1bedc..089bde138185bf973eeb5e2f27e2ea0363ade300 100644 (file)
@@ -9,5 +9,5 @@ doc symbol=Enum
 The _one_ {and only}
     arg=two
 
-    section=
+    section=None
 @two is undocumented
index c55e394e8a28bb96e55a44e6fd66bd7adf70127a..1d2c250527fa0fdd52dcde1c7196a60f58391d4e 100644 (file)
@@ -82,7 +82,7 @@ doc symbol=Enum
 The _one_ {and only}
     arg=two
 
-    section=
+    section=None
 @two is undocumented
 doc symbol=Base
     body=