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