Created
May 18, 2014 20:39
-
-
Save mwcraig/61291289b892b5014472 to your computer and use it in GitHub Desktop.
Originally from Stuart Mumford/sunpy, I think...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Wed Jul 31 18:29:35 2013 | |
| @author: stuart | |
| """ | |
| from __future__ import print_function | |
| import os | |
| header = [ | |
| '<html>\n', | |
| '<head>\n', | |
| '<title>Wheelhouse Spoke</title>\n', | |
| '</head>\n', | |
| '<body>\n' | |
| ] | |
| for root, direc, files in os.walk('.'): | |
| wheels = [] | |
| print("In {}", root) | |
| for f in files: | |
| if os.path.splitext(f)[1] == '.whl': | |
| wheels.append(f) | |
| if wheels: | |
| wheels.sort() | |
| outf = open(os.path.join(root, "index.html"), 'w') | |
| outf.writelines(header) | |
| for wheel in wheels: | |
| outf.write("<a href=%s>%s</a></br>\n" % (wheel, wheel)) | |
| outf.write("</body>\n") | |
| outf.write("</html>\n") | |
| outf.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment