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

Class HintsWriter

Tools/unicode/genmap_tchinese.py:187–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185
186
187class HintsWriter:
188 filler_class = BufferedFiller
189
190 def __init__(self, fp, prefix, isbmpmap):
191 self.fp = fp
192 self.prefix = prefix
193 self.isbmpmap = isbmpmap
194 self.filler = self.filler_class()
195
196 def fillhints(self, hintfrom, hintto):
197 name = f'{self.prefix}_phint_{hintfrom}'
198 self.fp.write(f'static const unsigned char {name}[] = {{\n')
199 for msbcode in range(hintfrom, hintto+1, 8):
200 v = 0
201 for c in range(msbcode, msbcode+8):
202 v |= self.isbmpmap.get(c, 0) << (c - msbcode)
203 self.filler.write('%d,' % v)
204 self.filler.printout(self.fp)
205 self.fp.write('};\n\n')
206
207
208def main_hkscs():

Callers 1

main_hkscsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…