MCPcopy Create free account
hub / github.com/psf/black / main

Function main

scripts/make_width_table.py:49–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48
49def main() -> None:
50 table_path = join(dirname(__file__), "..", "src", "black", "_width_table.py")
51 with open(table_path, "w") as f:
52 f.write(
53 f"""# Generated by {basename(__file__)}
54# wcwidth {wcwidth.__version__}
55# Unicode {wcwidth.list_versions()[-1]}
56import sys
57from typing import List, Tuple
58
59if sys.version_info < (3, 8):
60 from typing_extensions import Final
61else:
62 from typing import Final
63
64WIDTH_TABLE: Final[List[Tuple[int, int, int]]] = [
65"""
66 )
67 for triple in make_width_table():
68 f.write(f" {triple!r},\n")
69 f.write("]\n")
70
71
72if __name__ == "__main__":

Callers 1

Calls 1

make_width_tableFunction · 0.85

Tested by

no test coverage detected