[svn r7406] Lots of improvements to the prospecting guide

This commit is contained in:
olly
2006-06-22 03:01:02 +02:00
parent 83b642ae71
commit 3d9ccbca7a
9 changed files with 1915 additions and 1200 deletions

View File

@@ -24,7 +24,7 @@ areanames = {
'8d': '8d – Loser-Hochganger ridge',
'9': '9 – Gschwandt Alm',
'10': '10 – Altaussee',
'11': '11 – Augstbach',
'11': '11 – Augstbach'
}
areacolours = {
@@ -36,6 +36,7 @@ areacolours = {
'2b' : '#00ff00',
'2c' : '#008800',
'2d' : '#ff9900',
'3' : '#880000',
'4' : '#0000ff',
'6' : '#000000', # doubles for surface fixed pts
'7' : '#808080'
@@ -47,23 +48,23 @@ for a in areas: cavelists[a]=[]
def chomp(s):
if not s: return s
if not s: return s
if s[-1]=="\n": return chomp(s[:-1])
elif s[-1]==" ": return chomp(s[:-1])
else: return s
else: return s
def find_effective_number(c):
"""Determine an appropriate number to use."""
if c["Kataster Number"]:
return c["Kataster Number"]
else:
return c["Unofficial number"]
"""Determine an appropriate number to use."""
if c["Kataster Number"]:
return c["Kataster Number"]
else:
return c["Unofficial number"]
def longnumber(c, number):
"""Both numbers"""
if (c["Unofficial number"] and c["Unofficial number"] != number):
return number + " (" + c["Unofficial number"] + ")"
else:
"""Both numbers"""
if (c["Unofficial number"] and c["Unofficial number"] != number):
return number + " (" + c["Unofficial number"] + ")"
else:
return number
def find_location(cave):
@@ -72,6 +73,7 @@ def find_location(cave):
return positions[cave[fixtype]]
return 0
def munge_allposline(line):
x, y, z, name = re.match(r'\(([0-9.]*?),\s*([0-9.]*?),\s*([0-9.]*?)\s*\)\s*(.*)\n', line).groups()
x,y, z = map(float, [x,y,z])
@@ -127,6 +129,7 @@ import csv, re, time
cavetabfile = file("../CAVETAB2.CSV")
fieldnames=chomp(cavetabfile.next()).replace('"','').split(",")
cavetab = csv.DictReader(cavetabfile, fieldnames)
positionfile = file("../all.pos")
positionfile.next()
positions = {}
@@ -169,19 +172,22 @@ for cave in cavetab:
cachedarea = cave["Area"]
area = cave["Area"]
if area == '1626': continue
# We have some areas like '2b or 4 (unclear)' - just chop the space
# and everything after it for these.
area = re.sub(r' .*', "", area)
if area == '1626' or area == 'nonexistent': continue
loctuple = find_location(cave)
if(cave["Multiple entrances"] == "yes"):
locn = "<td colspan=\"3\">&nbsp;</td>"
elif(loctuple):
locn = "<td class=\"locn good\">%d</td><td class=\"locn good\">%d</td><td class=\"locn good\">%d</td>" % loctuple
else:
locn = "<td colspan=\"3\" class=%s>" % findability_color(cave) + cave["Findability"] + "</td>"
try:#if(not cavelists.has_key(area)): cavelists[area]=[]
locn = "<td colspan=\"3\" class=%s>" % findability_color(cave) + (cave["Findability"] or '?') + "</td>"
try:
cavelists[area].append((number, cave, locn))
except:
print number, area
print "Bad area '%s' for cave %s" % (area, number)
for area in areas:
if area:
@@ -200,7 +206,7 @@ for area in areas:
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"):
htmlfile.write("<td class=\"locn\">%s %s</td>" % (cave["Location"], cave["Bearings"]))