Created
May 11, 2010 18:26
-
-
Save kennydude/397644 to your computer and use it in GitHub Desktop.
Generates a html file with all the fugue shadowless icons in it!
This file contains 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
#!/usr/bin/python | |
''' | |
Tools for generating html for fugue icons | |
THEY MUST BE IN DIR fugue-icons FROM THIS SCRIPT! | |
Make sure you can write to icons.html | |
Your web browser may crash while first rendering | |
''' | |
print "Generating html..." | |
import os | |
def dofiles(files, dir): | |
o = '' | |
for file in files: | |
if file.endswith(".png"): | |
o += ''' | |
<img src="%(dir)s/%(file)s" title="%(file)s" /> | |
''' % { "dir" : dir, "file":file } | |
return o | |
dirs = [ | |
"fugue-icons/icons-shadowless", | |
"fugue-icons/bonus/icons-shadowless-32", | |
"fugue-icons/bonus/icons-shadowless-24", | |
] | |
o = open("icons.html", 'w') | |
o.writelines(''' | |
<html> | |
<title>Fugue Icons</title> | |
<body> | |
<h1>Fugue Icons - Shaddowless</h1> | |
''') | |
for dir in dirs: | |
o.writelines( | |
dofiles(os.listdir(dir), dir) | |
) | |
o.close() | |
print "Done :)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment