3 # Generate a static fbsplash theme gallery. Run as:
4 # ./gengallery.py > index.html
7 import xml
.etree
.ElementTree
as et
14 for theme
in sorted(os
.listdir('unpacked')):
15 if not os
.path
.isdir('unpacked/' + theme
):
18 # Only themes with valid metadata are considered.
20 f
= open('unpacked/' + theme
+ '/metadata.xml', 'r')
26 name
= meta
.find('name').text
27 ver
= meta
.find('version').text
28 author
= meta
.find('author/name').text
29 email
= meta
.find('author/email').text
30 desc
= meta
.find('description').text
31 lic
= meta
.find('license').text
37 shot
= '../themes/shots/%s-%s.png' % (size
, theme
)
38 shott
= '../themes/shots/thumbs/%s-%s.jpg' % (tsize
, theme
)
40 print '<tr><td><a href="%s"><img src="%s" alt="%s" /></a>' % (shot
, shott
, name
)
42 fbcd
= '../themes/shots/%s-%s-fbcondecor.png' % (size
, theme
)
43 fbcdt
= '../themes/shots/thumbs/%s-%s-fbcondecor.jpg' % (tsize
, theme
)
45 if os
.path
.exists(fbcd
):
46 print '<a href="%s"><img src="%s" alt="%s fbcondecor" /></a>' % (fbcd
, fbcdt
, name
)
48 print '<br /><span class="theme">'
50 print '<a href="%s">%s v. %s</a>,' % (url
, name
, ver
)
52 print '%s v. %s,' % (name
, ver
)
54 f1
= open(os
.path
.join('unpacked', theme
, '.origin'), 'r')
55 filename
= f1
.readlines()[0][:-1]
58 print '<b><a href="../themes/%s">download</a></b>' % filename
60 print '</span><br /><span class="desc">%s</span><br /><br />' % desc