qapi: Pass file name to QAPIGen constructor instead of methods

Not much of an improvement now, but the next commit will profit.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190301154051.23317-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Markus Armbruster 2019-03-01 16:40:47 +01:00
parent 0f20628b24
commit dddee4d7ba
3 changed files with 38 additions and 36 deletions

View file

@ -207,11 +207,11 @@ def texi_entity(doc, what, ifcond, base=None, variants=None,
class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor):
def __init__(self, prefix):
self._prefix = prefix
self._gen = qapi.common.QAPIGenDoc()
self._gen = qapi.common.QAPIGenDoc(self._prefix + 'qapi-doc.texi')
self.cur_doc = None
def write(self, output_dir):
self._gen.write(output_dir, self._prefix + 'qapi-doc.texi')
self._gen.write(output_dir)
def visit_enum_type(self, name, info, ifcond, members, prefix):
doc = self.cur_doc