| # QAPI frontend source file info |
| # Copyright (c) 2019 Red Hat Inc. |
| # Markus Armbruster <armbru@redhat.com> |
| # This work is licensed under the terms of the GNU GPL, version 2. |
| # See the COPYING file in the top-level directory. |
| class QAPISchemaPragma(object): |
| # Are documentation comments required? |
| self.doc_required = False |
| # Whitelist of commands allowed to return a non-dictionary |
| self.returns_whitelist = [] |
| # Whitelist of entities allowed to violate case conventions |
| self.name_case_whitelist = [] |
| class QAPISourceInfo(object): |
| def __init__(self, fname, line, parent): |
| self.pragma = parent.pragma if parent else QAPISchemaPragma() |
| def set_defn(self, meta, name): |
| if self.line is not None: |
| return "%s: In %s '%s':\n" % (self.fname, |
| self.defn_meta, self.defn_name) |
| ret = 'In file included from %s:\n' % parent.loc() + ret |
| return self.include_path() + self.in_defn() + self.loc() |