html.py: replace Windows backslashes in icon paths

This is one source of missing-image results.

There remain other reasons for missing icons. The script doesn't find images
in add-ons. And when resources are moved or renamed, they are no longer found
by the script, even if they had been found before.

Also, capitalize a sentence.
This commit is contained in:
Groggy Dice 2014-05-05 04:05:39 -04:00
parent faf82bed92
commit 7ba550a63e

View file

@ -78,6 +78,7 @@ Select the add-on you want to install from the list and click "OK". The download
icon = icon.strip()
tilde = icon.find("~")
if tilde >= 0: icon = icon[:tilde]
if "\\" in icon: icon = icon.replace("\\", "/")
try: os.mkdir(path + "/icons")
except OSError: pass
if "." not in icon: icon += ".png"
@ -130,7 +131,7 @@ Usually comes with an era or is dependency of another add-on.</div></td>""")
elif type == "media":
w("""\
<td>Resources<div class="type"><b>miscellaneous content/media</b><br/>
unit packs, terrain packs, music packs, etc. Usually a (perhaps optional) dependency of another add-on.</div></td>""")
Unit packs, terrain packs, music packs, etc. Usually a (perhaps optional) dependency of another add-on.</div></td>""")
else: w(('<td>%s</td>') % type)
w(('<td><img alt="%s" src="%s" width="72px" height="72px"/>'
) % (icon, imgurl))