[svn r7277] Updated so it works on my machine. Not sure why this needs to be in CVS, but there you go.

This commit is contained in:
dave
2005-11-07 16:02:02 +01:00
parent eb326bb124
commit 5dd695a75b
5 changed files with 158 additions and 137 deletions

View File

@@ -111,6 +111,18 @@ def is_underground_surveyed(cave):
else:
return "<td class=\"bad\">Missing</td>"
def has_photo(cave):
s = chomp(cave["Photo of location"])
if ((cave["Multiple entrances"] not in ["", "yes"]) and chomp(cave["Autogen file"]) == ""):
return "<td></td>"
if not s:
return "<td class=\"awful\">None</td>"
if s and (s.find("<img") > -1 or s.find("<a") > -1):
return "<td class=\"good\">Yes</td>"
else:
return "<td class=\"bad\">Missing</td>"
import csv, re, time
cavetabfile = file("../CAVETAB2.CSV")
fieldnames=chomp(cavetabfile.next()).replace('"','').split(",")
@@ -176,7 +188,7 @@ for area in areas:
htmlfile.write("<tr><td colspan=\"9\" style=\"padding-top: 3em; padding-bottom: 1em; border: 0; text-align: center\"><h3>%s</h3></td></tr>" % areanames[area])
else:
htmlfile.write("<tr><td colspan=\"9\" style=\"padding-top: 3em; padding-bottom: 1em; text-align: center\"><h3>Location unclear</h3></td></tr>")
htmlfile.write("<tr><th>Cave Number</th><th>Name</th><th>Finished</th><th>Surveyed</th><th>Marked</th><th>E</th><th>N</th><th>Alt</th><th>Location</th>")
htmlfile.write("<tr><th>Cave Number</th><th>Name</th><th>Finished</th><th>Surveyed</th><th>Marked</th><th>Photoed</th><th>E</th><th>N</th><th>Alt</th><th>Location</th>")
for (number, cave, locn) in cavelists[area]:
if cave["Autogen file"]:
@@ -187,6 +199,7 @@ for area in areas:
htmlfile.write(is_explored(cave))
htmlfile.write(is_underground_surveyed(cave))
htmlfile.write(is_tagged(cave))
htmlfile.write(has_photo(cave))
htmlfile.write(locn)
if(cave["Findability"] != "Surveyed" and cave["Multiple entrances"] != "yes"):