gdbus: Don't output invalid empty <variablelist> tags

Docbook doesn't allow an empty <variablelist> and so the docbook
output from gdbus-codegen is invalid when a method/signal has
no arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=692865
This commit is contained in:
Stef Walter 2013-01-30 11:07:52 +01:00
parent a60014f1b6
commit 11e208f9d6

View File

@ -173,6 +173,7 @@ class DocbookCodeGenerator:
self.print_method_prototype(i, m, in_synopsis=False)
self.out.write('</programlisting>\n')
self.out.write('<para>%s</para>\n'%(self.expand(m.doc_string, True)))
if m.in_args or m.out_args:
self.out.write('<variablelist role="params">\n')
for a in m.in_args:
self.out.write('<varlistentry>\n'%())
@ -199,6 +200,7 @@ class DocbookCodeGenerator:
self.print_signal_prototype(i, s, in_synopsis=False)
self.out.write('</programlisting>\n')
self.out.write('<para>%s</para>\n'%(self.expand(s.doc_string, True)))
if s.args:
self.out.write('<variablelist role="params">\n')
for a in s.args:
self.out.write('<varlistentry>\n'%())