[svn r6489] Fettled folk list: python script now works rather better, and added some more photos.

This commit is contained in:
dave
2004-09-07 23:01:05 +02:00
parent 4a4bf25673
commit 2385c97b7f
7 changed files with 272 additions and 240 deletions

View File

@@ -1,31 +1,37 @@
#!/usr/bin/python
import sys, string, re
total = 0
headcount = 0
pics = 0
allyears = 0
recordholders = []
output = ""
lines = sys.stdin.readlines()
allyears = len(lines[0].split(','))-7
headcounts_byyear = [0]*(len(lines[0].split(","))-5)
for r in lines[1:-1]:
cells = r.split(",")
(name, didntcave, guest, vfho, mug) = cells[:5]
years = cells[5:-1]
expos = cells[-1]
if(didntcave!='1' and name != 'Rover Richardson'): total +=1
r = r.replace("\n","")
r = r.replace("\r", "")
cells = r.split(",") # chomp newline
(name, guest, vfho, mug) = cells[:4]
years = cells[4:]
expos_caving = len([t for t in years if t == "1"])
expos_notcaving = len([t for t in years if t == "-1"])
if(expos_caving == 0 and expos_notcaving == 0):
sys.stdout.write("Error for", name)
sys.exit(1)
if(expos_caving and name != 'Rover Richardson'): headcount += 1
if mug: pics +=1
output += '<tr><td style="border: 1px solid black">'
if didntcave: output += '<span class="didntcave">'
output += '<tr><td>'
if expos_caving == 0: output += '<span class="didntcave">'
output += name[1:-1].replace('""', '"')
if didntcave: output += '</span>'
output += '</td><td style="border: 1px solid black">'
if expos_caving == 0: output += '</span>'
output += '</td><td>'
if guest: output += '&sect;'
output += '</td><td style="border: 1px solid black">'
output += '</td><td>'
if vfho: output += '&curren;'
output += '</td><td style="border: 1px solid black">'
output += '</td><td>'
if mug: output += '<a href=%s><img alt=":-)" src="../../icons/mug.png" /></a>' % mug
output += '&nbsp;</td>'
for y in xrange(len(years)):
@@ -33,17 +39,23 @@ for r in lines[1:-1]:
m = str(76 + y)[-2:]
if(years[y]=='-1'):
m = '<span class="didntcave">'+ m + '</span>'
else:
headcounts_byyear[y] += 1
output += '<td class="nonempty">' + m + '</td>'
else:
output += '<td></td>'
output += '</tr>\n'
if(expos_notcaving):
output += '<td style="text-align: right">%d + <span class="didntcave">%d</span></td></tr>\n' % (expos_caving, expos_notcaving)
else:
output += '<td style="text-align: right">%d</td></tr>\n' % expos_caving
recordholders.append((expos_caving, name))
def collapse(m):
n = (m.span()[1]-m.span()[0]) / 9
if(n == 1): return m.group()
else: return '<td colspan="%d"></td>' % n
output = re.sub(r'(<td></td>)+',collapse, output)
#output = re.sub(r'(<td></td>)+',collapse, output)
print """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -54,11 +66,10 @@ print """
<link rel="stylesheet" type="text/css" href="../css/main2.css" />
<style type="text/css">
<!--
.didntcave { font-color: #cc0000 }
table.fancy { border-collapse: collapse; border: 2px solid #000 }
table.fancy td { border-top: 1px solid #000; border-bottom: 1px solid #000;
padding: 2pt; }
table.fancy td.nonempty { background: #eee; border-left: 1px solid #888; border-right: 1px solid #888 }
.didntcave { color: #dd0000 }
table.fancy { border-collapse: collapse; border: 2px solid black }
table.fancy td { border: 1px solid black; padding: 2pt }
table.fancy td.nonempty { background: #eee }
-->
</style>
</head>
@@ -68,20 +79,20 @@ table.fancy td.nonempty { background: #eee; border-left: 1px solid #888; border-
<h1>CUCC members and guests in Austria 1976 to present</h1>
<p>Being a pretty much complete list of all the personnel on %d CUCC
expeditions (there was no expo in 1986). Names for the current year (as updated
before departure) are always subject to revision in the light of reality !
People sometimes get missed out because no-one has told me their surnames :-(
<!-- Sharon in 2000 --></p>
expeditions (there was no expo in 1986), together with the total number of
expeditions each has attended and the total number of people on each expedition.
Names for the current year (as updated before departure) are always subject
to revision in the light of reality ! People sometimes get missed out because
no-one has told me their surnames :-( <!-- Sharon in 2000 --></p>
<p>Qualification for inclusion involves some active contribution to the
expedition such as going underground, surface surveying or sherpa-ing, or
diving for resurgences. Years marked in <span style="didntcave">red</span>
indicate some certainty that the person didn't go underground that year.
Persons marked in <span class="didntcave">red</span> are thought to have never
been underground on expo and are therefore likely to vanish from future
editions. Note that diving in <span lang="de-at">Altausseer See</span> for the
resurgence has been counted as underground:- it certainly counts as effort
expended in the pursuit of speleology!</p>
been underground on expo at all. Note that diving in <span lang="de-at">Altausseer
See</span> for the resurgence has been counted as underground:- it certainly
counts as effort expended in the pursuit of speleology!</p>
<p>In the table, a section mark (&sect;) indicates someone who was an
individual guest of CUCC or of a CUCC member, or who was a member of UBSS when
@@ -101,19 +112,41 @@ Steinberger and Robert Seebacher <a href="i/robert.jpg"><img alt=":-)"
src="../../icons/mug.png" /></a>.</p>
<hr /><table class="fancy">
""" % allyears
""" % len([t for t in headcounts_byyear if t > 0])
print output
print "<tr><td colspan=4><strong>Expo head count</strong></td>",
for y in headcounts_byyear:
print '<td style="text-align: right">%d</td>' % y,
print """
</table><hr />
<td></td></tr>
</table>
<hr />
<p>%d people have
taken part in expo altogether (not counting non-combatants or vehicles(!)),
of whom %d have their pictures on the site so far.</p>
<p>Outside-expo caving has started, with Becka Lawson, Julian Todd and Wookey
<p>Although few take such statistics seriously, the most dedicated expoers are """ % (headcount, pics)
recordholders.sort()
recordholders.reverse()
k = 2
while recordholders[k + 1][0] == recordholders[k][0]:
k = k + 1
print "%s (%d expos)," % (recordholders[0][1][1:-1],recordholders[0][0])
for r in recordholders[1:k]:
print "%s (%d)," % (r[1][1:-1],r[0]),
print """and %s (%d). Julian Haines and Brian Outram share the record for
consecutive expos (9 each). A more obscure record was set by Mark Dougherty in 2004:
longest interval between expos (13 years).""" % (recordholders[k][1][1:-1],recordholders[k][0])
print """<p>Outside-expo caving has started, with Becka Lawson, Julian Todd and Wookey
joining various Arge trips in recent years. However, the much talked-about
winter expedition/holiday has still not happened, though there is still a lot
to be said for it. With draughts reversed in the cold, top entrances should
@@ -148,4 +181,4 @@ remain open all winter.</p>
<li><a href="../others/index.htm">Other groups</a> who have worked in the area.</li>
</ul></li></ul>
</body>
</html>""" % (total, pics)
</html>"""