We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90a58f5 commit 1c13a43Copy full SHA for 1c13a43
tools/genMD.py
100755
100644
@@ -1,8 +1,12 @@
1
-import os
+from pathlib import Path
2
3
-with open('README.md', 'w') as mkdn:
4
- mkdn.write("Screenshots\n===\n")
5
- for f in [f for f in os.listdir('.') if os.path.isfile(f)]:
6
- mkdn.write("`%s`\n\n" % f)
7
- mkdn.write("\n\n" % f)
+screenshot_dir = (Path(__file__).parent / '../screenshots').resolve()
+screenshot_paths = list(screenshot_dir.glob('**/*.png'))
+screenshots = map(lambda path: path.name, screenshot_paths)
8
+readme_path = (screenshot_dir / 'README.md')
+with open(readme_path, 'w') as readme:
9
+ readme.write('# Screenshots\n\n')
10
+ for ss in sorted(screenshots, key=str.lower):
11
+ readme.write(f'`{ss}`\n')
12
+ readme.write(f'\n\n')
0 commit comments