mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-01-18 08:52:37 +00:00
[svn r7420] non CUCC caves are marked in white in the prospecting guide, most
entrances are now marked with explorers
This commit is contained in:
parent
5bbdda9e33
commit
b9bad3529c
File diff suppressed because one or more lines are too long
@ -1,6 +1,8 @@
|
||||
# Script to create a slightly more useful attempt
|
||||
# at a prospecting guide.
|
||||
|
||||
import re
|
||||
|
||||
areas = ['', '1a','1b','1c','1d', '2a', '2b', '2c', '2d', '3', '4', '5', '6','7', '8a', '8b', '8c', '8d', '9', '10', '11']
|
||||
|
||||
areanames = {
|
||||
@ -42,6 +44,8 @@ areacolours = {
|
||||
'7' : '#808080'
|
||||
}
|
||||
|
||||
#Regular Expression for comparing to CUCC
|
||||
REcucc = re.compile('CUCC')
|
||||
|
||||
cavelists={}
|
||||
for a in areas: cavelists[a]=[]
|
||||
@ -82,10 +86,13 @@ def is_explored(cave):
|
||||
print "Rogue space in " + find_effective_number(cave)
|
||||
return "<td></td>"
|
||||
code = s[-1]
|
||||
if code == '+': status = "good"
|
||||
elif code in ['=', 'x']: status = "bad"
|
||||
elif code in ['-', '?']: status = "awful"
|
||||
else: return "<td>%s</td>" % code
|
||||
if REcucc.search(cave['Explorers']):
|
||||
if code == '+': status = "good"
|
||||
elif code in ['=', 'x']: status = "bad"
|
||||
elif code in ['-', '?']: status = "awful"
|
||||
else: return "<td>%s</td>" % code
|
||||
else:
|
||||
status = 'notCUCCsfault'
|
||||
return "<td class=\"%s\">%s</td>" % (status, code)
|
||||
|
||||
def is_tagged(cave):
|
||||
@ -93,54 +100,92 @@ def is_tagged(cave):
|
||||
s = re.sub(r'\s+(?:\(\?\))?$', "", s)
|
||||
if not s and cave["Multiple entrances"] in ["yes", "entrance", "last entrance"]:
|
||||
return "<td></td>"
|
||||
if s == "Tag": return "<td class=\"good\">%s</td>" % s
|
||||
if s in ["Retag", "Paint", "Spit"]: return "<td class=\"bad\">%s</td>" % s
|
||||
if s == "Unmarked": return "<td class=\"awful\">None</td>"
|
||||
if s == "": return "<td class=\"awful\"></td>"
|
||||
if REcucc.search(cave['Explorers']):
|
||||
if s == "Tag": return "<td class=\"good\">%s</td>" % s
|
||||
if s in ["Retag", "Paint", "Spit"]: return "<td class=\"bad\">%s</td>" % s
|
||||
if s == "Unmarked": return "<td class=\"awful\">None</td>"
|
||||
if s == "": return "<td class=\"awful\"></td>"
|
||||
else:
|
||||
if s == "Tag": return "<td class=\"notCUCCsfault\">%s</td>" % s
|
||||
if s in ["Retag", "Paint", "Spit"]: return "<td class=\"notCUCCsfault\">%s</td>" % s
|
||||
if s == "Unmarked": return "<td class=\"notCUCCsfault\">None</td>"
|
||||
if s == "": return "<td class=\"notCUCCsfault\"></td>"
|
||||
print "Unrecognised marking status on %s: %s" % (find_effective_number(cave), repr(s))
|
||||
return "<td>ERROR</td>"
|
||||
|
||||
def findability_color(cave):
|
||||
if cave["Findability"] == "Surveyed": return "good"
|
||||
elif cave["Findability"] == "Refindable": return "bad"
|
||||
elif cave["Findability"] == "Lost": return "awful"
|
||||
else: return ""
|
||||
if REcucc.search(cave['Explorers']):
|
||||
if cave["Findability"] == "Surveyed": return "good"
|
||||
elif cave["Findability"] == "Refindable": return "bad"
|
||||
elif cave["Findability"] == "Lost": return "awful"
|
||||
else: return ""
|
||||
else:
|
||||
return "notCUCCsfault"
|
||||
|
||||
def is_underground_surveyed(cave):
|
||||
s = chomp(cave["Underground drawn survey"])
|
||||
if(cave["Multiple entrances"] not in ["", "yes"]): 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>"
|
||||
if REcucc.search(cave['Explorers']):
|
||||
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>"
|
||||
else:
|
||||
return "<td class=\"bad\">Missing</td>"
|
||||
if not s:
|
||||
return "<td class=\"notCUCCsfault\">None</td>"
|
||||
if s and (s.find("<img") > -1 or s.find("<a") > -1):
|
||||
return "<td class=\"notCUCCsfault\">Yes</td>"
|
||||
else:
|
||||
return "<td class=\"notCUCCsfault\">Missing</td>"
|
||||
|
||||
def have_survey_data(cave):
|
||||
if(cave["Multiple entrances"] not in ["", "yes"]): return "<td></td>"
|
||||
s = chomp(cave["Underground centre line"])
|
||||
if s: return "<td class=\"good\">Yes</td>"
|
||||
s = chomp(cave["Survex file to get length and depth"])
|
||||
if s: return "<td class=\"good\">Yes</td>"
|
||||
if cave["Kat Status Code"] and cave["Kat Status Code"][0] == '1':
|
||||
# Cave < 50m deep and < 50m long...
|
||||
# Sadly this band includes caves we really ought to have data for as
|
||||
# well as caves small enough that a grade 1 sketch is justifiable.
|
||||
return "<td class=\"bad\"><small><50m</small></td>"
|
||||
s = chomp(cave["Underground drawn survey"])
|
||||
if s: return "<td class=\"bad\">Missing</td>"
|
||||
return "<td class=\"awful\">None</td>"
|
||||
if REcucc.search(cave['Explorers']):
|
||||
if s: return "<td class=\"good\">Yes</td>"
|
||||
s = chomp(cave["Survex file to get length and depth"])
|
||||
if s: return "<td class=\"good\">Yes</td>"
|
||||
if cave["Kat Status Code"] and cave["Kat Status Code"][0] == '1':
|
||||
# Cave < 50m deep and < 50m long...
|
||||
# Sadly this band includes caves we really ought to have data for as
|
||||
# well as caves small enough that a grade 1 sketch is justifiable.
|
||||
return "<td class=\"bad\"><small><50m</small></td>"
|
||||
s = chomp(cave["Underground drawn survey"])
|
||||
if s: return "<td class=\"bad\">Missing</td>"
|
||||
return "<td class=\"awful\">None</td>"
|
||||
else:
|
||||
if s: return "<td class=\"notCUCCsfault\">Yes</td>"
|
||||
s = chomp(cave["Survex file to get length and depth"])
|
||||
if s: return "<td class=\"notCUCCsfault\">Yes</td>"
|
||||
if cave["Kat Status Code"] and cave["Kat Status Code"][0] == '1':
|
||||
# Cave < 50m deep and < 50m long...
|
||||
# Sadly this band includes caves we really ought to have data for as
|
||||
# well as caves small enough that a grade 1 sketch is justifiable.
|
||||
return "<td class=\"notCUCCsfault\"><small><50m</small></td>"
|
||||
s = chomp(cave["Underground drawn survey"])
|
||||
if s: return "<td class=\"notCUCCsfault\">Missing</td>"
|
||||
return "<td class=\"notCUCCsfault\">None</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>"
|
||||
if REcucc.search(cave['Explorers']):
|
||||
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>"
|
||||
else:
|
||||
return "<td class=\"bad\">Missing</td>"
|
||||
if not s:
|
||||
return "<td class=\"notCUCCsfault\">None</td>"
|
||||
if s and (s.find("<img") > -1 or s.find("<a") > -1):
|
||||
return "<td class=\"notCUCCsfault\">Yes</td>"
|
||||
else:
|
||||
return "<td class=\"notCUCCsfault\">Missing</td>"
|
||||
|
||||
def find_label(cave, number):
|
||||
t = longnumber(cave, number) + " "
|
||||
@ -392,6 +437,7 @@ htmlfile.write("""
|
||||
.bad { background-color: #ff9955; text-align: center }
|
||||
.good { background-color: #99ff99; text-align: center }
|
||||
.awful { background-color: #ff5555; text-align: center }
|
||||
.notCUCCsfault { background-color: #ffffff; text-align: center }
|
||||
</style></head>""")
|
||||
htmlfile.write("<body><h1>Prospecting Guide</h1>")
|
||||
htmlfile.write("<p><small>Generated " + time.strftime("%x %X") + " by " + sys.argv[0] + "</small></p>\n")
|
||||
|
Loading…
Reference in New Issue
Block a user