Commit fc3f0df1 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

qapi: Unify representation of doc section without name



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: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-8-armbru@redhat.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent 0968dc9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -9,5 +9,5 @@ doc symbol=Enum
The _one_ {and only}
    arg=two

    section=
    section=None
@two is undocumented
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ doc symbol=Enum
The _one_ {and only}
    arg=two

    section=
    section=None
@two is undocumented
doc symbol=Base
    body=