()
| 15 | |
| 16 | |
| 17 | def 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 | |
| 39 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…