MCPcopy Index your code
hub / github.com/python/cpython / printmap

Method printmap

Tools/unicode/genmap_support.py:152–168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

150 self.filler.write(str(point) + ',')
151
152 def printmap(self):
153 self.fp.write(f"static const {self.elemtype} __{self.prefix}_encmap[{len(self.filler)}] = {{\n")
154 self.filler.printout(self.fp)
155 self.fp.write("};\n\n")
156 self.fp.write(f"static const {self.indextype} {self.prefix}_encmap[256] = {{\n")
157
158 for i in range(256):
159 if i in self.encode_map and self.prefix in self.encode_map[i]:
160 self.filler.write("{", "__%s_encmap" % self.prefix, "+",
161 "%d" % self.encode_map[i]['midx'], ",",
162 "%d," % self.encode_map[i]['min'],
163 "%d" % self.encode_map[i]['max'], "},")
164 else:
165 self.filler.write("{", "0,", "0,", "0", "},")
166 continue
167 self.filler.printout(self.fp)
168 self.fp.write("};\n\n")
169
170
171def open_mapping_file(path, source):

Callers 1

generateMethod · 0.95

Calls 2

printoutMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected