MCPcopy Index your code
hub / github.com/ipython/ipython / main

Function main

tools/fixup_whats_new_pr.py:17–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17def main():
18 folder = Path("docs/source/whatsnew/pr/")
19 files = list(folder.glob("*.rst"))
20 print(files)
21
22 for filepath in files:
23 print("Adding pseudo-title to:", filepath.name)
24 title = filepath.name[:-4].split("/")[-1].replace("-", " ").capitalize()
25
26 data = filepath.read_text(encoding="utf-8")
27 try:
28 if data and data.splitlines()[1].startswith("="):
29 continue
30 except IndexError:
31 pass
32
33 with filepath.open("w", encoding="utf-8") as f:
34 f.write(title + "\n")
35 f.write("=" * len(title) + "\n\n")
36 f.write(data)
37
38
39if __name__ == "__main__":

Callers 1

Calls 2

replaceMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…