MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / writeDict

Method writeDict

scripts/pygenerator.py:27–38  ·  view source on GitHub ↗

Write dictionary as a Python dictionary with the given name. If printValues is False, just output keys with None values.

(self, dict, name, printValues = True)

Source from the content-addressed store, hash-verified

25 return '}'
26
27 def writeDict(self, dict, name, printValues = True):
28 """Write dictionary as a Python dictionary with the given name.
29 If printValues is False, just output keys with None values."""
30
31 write(self.beginDict(name), file=self.outFile)
32 for key in sorted(dict):
33 if printValues:
34 value = enquote(dict[key])
35 else:
36 value = 'None'
37 write(f'{enquote(key)} : {value},', file=self.outFile)
38 write(self.endDict(), file=self.outFile)
39
40 def writeList(self, l, name):
41 """Write list l as a Ruby hash with the given name"""

Callers 2

writeListMethod · 0.95
endFileMethod · 0.95

Calls 4

beginDictMethod · 0.95
endDictMethod · 0.95
writeFunction · 0.90
enquoteFunction · 0.90

Tested by

no test coverage detected