From 9d11e22ab62f2cff50041ccdd27056945fd2a50f Mon Sep 17 00:00:00 2001 From: Petr Kraus Date: Mon, 23 Jul 2018 15:40:30 +0200 Subject: [PATCH] Fix metadoc script showing non-selected extensions mostly comments `doc += content` -> `doc += innerdoc ` does the fix --- xml/extensionmetadocgenerator.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xml/extensionmetadocgenerator.py b/xml/extensionmetadocgenerator.py index 7de0290d..34550c91 100644 --- a/xml/extensionmetadocgenerator.py +++ b/xml/extensionmetadocgenerator.py @@ -309,17 +309,19 @@ class ExtensionMetaDocOutputGenerator(OutputGenerator): if ifdef: if ifdef == 'ifndef': - if condition != None: + if condition: doc += 'ifndef::' + condition + '[]\n' doc += innerdoc doc += 'endif::' + condition + '[]\n' + else: # no condition is as if condition is defined; "nothing" is always defined :p + pass # so no output elif ifdef == 'ifdef': - if condition != None: + if condition: doc += 'ifdef::' + condition + '+' + extName + '[]\n' - doc += content + '\n' + doc += content + '\n' # does not include innerdoc; the ifdef was merged with the one above doc += 'endif::' + condition + '+' + extName + '[]\n' - else: - doc += content + '\n' + else: # no condition is as if condition is defined; "nothing" is always defined :p + doc += innerdoc else: # should be unreachable self.generator.logMsg('error', 'Logic error in conditionalExt(): ifdef is neither \'ifdef \' nor \'ifndef\'!') else: @@ -392,7 +394,7 @@ class ExtensionMetaDocOutputGenerator(OutputGenerator): write(self.conditionalExt(ext.name, include), file=current_extension_appendices_fp) write(self.conditionalExt(ext.name, link), file=current_extension_appendices_toc_fp) else: - condition = ext.supercedingVkVersion if ext.supercedingVkVersion else ext.supercedingExtension + condition = ext.supercedingVkVersion if ext.supercedingVkVersion else ext.supercedingExtension # potentially None too write(self.conditionalExt(ext.name, include, 'ifndef', condition), file=current_extension_appendices_fp) write(self.conditionalExt(ext.name, link, 'ifndef', condition), file=current_extension_appendices_toc_fp)