Skip to content

Instantly share code, notes, and snippets.

@kennydude
Created May 11, 2010 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennydude/397644 to your computer and use it in GitHub Desktop.
Save kennydude/397644 to your computer and use it in GitHub Desktop.
Generates a html file with all the fugue shadowless icons in it!
#!/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