Update for Vulkan-Docs 1.2.142

This commit is contained in:
Jon Leech 2020-06-01 04:52:39 -07:00 committed by Jon Leech
parent 09531f2793
commit db1a98c6cc
8 changed files with 3050 additions and 1579 deletions

View file

@ -119,6 +119,7 @@ class GeneratorOptions:
conventions=None,
filename=None,
directory='.',
genpath=None,
apiname=None,
profile=None,
versions='.*',
@ -136,7 +137,8 @@ class GeneratorOptions:
- conventions - may be mandatory for some generators:
an object that implements ConventionsBase
- filename - basename of file to generate, or None to write to stdout.
- directory - directory in which to generate filename
- directory - directory in which to generate files
- genpath - path to previously generated files, such as api.py
- apiname - string matching `<api>` 'apiname' attribute, e.g. 'gl'.
- profile - string specifying API profile , e.g. 'core', or None.
- versions - regex matching API versions to process interfaces for.
@ -176,6 +178,9 @@ class GeneratorOptions:
self.filename = filename
"basename of file to generate, or None to write to stdout."
self.genpath = genpath
"""path to previously generated files, such as api.py"""
self.directory = directory
"directory in which to generate filename"
@ -273,6 +278,10 @@ class OutputGenerator:
self.extBlockSize = 1000
self.madeDirs = {}
# API dictionary, which may be loaded by the beginFile method of
# derived generators.
self.apidict = None
def logMsg(self, level, *args):
"""Write a message of different categories to different
destinations.
@ -575,6 +584,17 @@ class OutputGenerator:
self.should_insert_may_alias_macro = \
self.genOpts.conventions.should_insert_may_alias_macro(self.genOpts)
# Try to import the API dictionary, api.py, if it exists. Nothing in
# api.py cannot be extracted directly from the XML, and in the
# future we should do that.
if self.genOpts.genpath is not None:
try:
sys.path.insert(0, self.genOpts.genpath)
import api
self.apidict = api
except ImportError:
self.apidict = None
self.conventions = genOpts.conventions
# Open a temporary file for accumulating output.