Show More
@@ -14,13 +14,13 b' notes.' | |||||
14 | from pathlib import Path |
|
14 | from pathlib import Path | |
15 |
|
15 | |||
16 | def main(): |
|
16 | def main(): | |
17 |
folder = Path( |
|
17 | folder = Path("docs/source/whatsnew/pr/") | |
18 |
files = list(folder.glob( |
|
18 | files = list(folder.glob("*.rst")) | |
19 | print(files) |
|
19 | print(files) | |
20 |
|
20 | |||
21 | for filepath in files: |
|
21 | for filepath in files: | |
22 |
print( |
|
22 | print("Adding pseudo-title to:", filepath.name) | |
23 |
title = filepath.name[:-4].split( |
|
23 | title = filepath.name[:-4].split("/")[-1].replace("-", " ").capitalize() | |
24 |
|
24 | |||
25 | data = filepath.read_text() |
|
25 | data = filepath.read_text() | |
26 | try: |
|
26 | try: | |
@@ -29,9 +29,9 b' def main():' | |||||
29 | except IndexError: |
|
29 | except IndexError: | |
30 | pass |
|
30 | pass | |
31 |
|
31 | |||
32 |
with filepath.open( |
|
32 | with filepath.open("w") as f: | |
33 |
f.write(title+ |
|
33 | f.write(title + "\n") | |
34 |
f.write( |
|
34 | f.write("=" * len(title) + "\n\n") | |
35 | f.write(data) |
|
35 | f.write(data) | |
36 |
|
36 | |||
37 | if __name__ == '__main__': |
|
37 | if __name__ == '__main__': |
General Comments 0
You need to be logged in to leave comments.
Login now