MCPcopy Index your code
hub / github.com/KhronosGroup/Vulkan-Docs / writeBlock

Method writeBlock

scripts/formatsgenerator.py:191–207  ·  view source on GitHub ↗

Generate an include file. - directory - subdirectory to put file in - basename - base name of the file - contents - contents of the file (Asciidoc boilerplate aside)

(self, basename, contents)

Source from the content-addressed store, hash-verified

189 OutputGenerator.endFile(self)
190
191 def writeBlock(self, basename, contents):
192 """Generate an include file.
193
194 - directory - subdirectory to put file in
195 - basename - base name of the file
196 - contents - contents of the file (Asciidoc boilerplate aside)"""
197
198 filename = f"{self.genOpts.directory}/{basename}"
199 self.logMsg('diag', '# Generating include file:', filename)
200 with open(filename, 'w', encoding='utf-8') as fp:
201 write(self.genOpts.conventions.warning_comment, file=fp)
202
203 if len(contents) > 0:
204 for str in contents:
205 write(str, file=fp)
206 else:
207 self.logMsg('diag', '# No contents for:', filename)
208
209 def genFormat(self, format, formatinfo, alias):
210 """Generate Formats

Callers 1

endFileMethod · 0.95

Calls 2

writeFunction · 0.90
logMsgMethod · 0.80

Tested by

no test coverage detected