folk updated ready for 2021 season

This commit is contained in:
Philip Sargent
2021-03-24 16:57:38 +00:00
parent db0b12e83f
commit 64fe1a1416
3 changed files with 347 additions and 343 deletions

View File

@@ -1,5 +1,6 @@
#!/usr/bin/python
import sys, string, re, os
from datetime import date
# run within the /folk/ folder:
# python ../scripts/make-folklist.py <folk.csv >index.htm
@@ -16,7 +17,7 @@ output = ""
lines = sys.stdin.readlines()
headcounts_byyear = [0]*(len(lines[0].split(","))-5)
yearnow = date.today().year
for r in lines[1:]:
r = r.replace("\n","")
@@ -43,7 +44,7 @@ for r in lines[1:]:
nameurl = nameurl.replace('&', '%26')
nameurl = nameurl.replace(';', '%3B')
nameurl = re.sub('<[^>]*>','',nameurl)
nameurl = re.sub('\([^\)]*\)','',nameurl) # mostly noit needed, but is for Wookey
nameurl = re.sub('\([^\)]*\)','',nameurl) # mostly not needed, but is for Wookey
namelink= "<a href='/person/" + nameurl + "'>" + namevis + "</a>"
output += namelink
#output += name.replace('""', '"')
@@ -92,7 +93,7 @@ def collapse(m):
#output = re.sub(r'(<td></td>)+',collapse, output)
lastyear=1976+1+len([t for t in headcounts_byyear if t > 0]) # no expo in 1986
lastyear=1976+1+len([t for t in headcounts_byyear if t > 0]) # no expo in 1986 or 2020
# moved to main.css
#<style type="text/css">
@@ -117,11 +118,11 @@ table.fancy td.nonempty { background: #eee }
<!-- DO NOT EDIT THIS DOCUMENT BY HAND! It is automatically generated by "scripts/make-folklist.py" -->
<h1>CUCC members and guests in Austria</br> 1976 to %s</h1>
""" % lastyear)
""" % yearnow)
print("""
<p>This is a pretty much complete list of all the personnel on %d CUCC
expeditions (there was no expo in 1986), together with the total number of
expeditions (there were no expos in 1986 or 2020), together with the total number of
expeditions each has attended and the total number of people on each expedition.</p>
<p>Qualification for inclusion involves some active contribution to the
@@ -155,7 +156,7 @@ src="i/mug.png" /></a>.</p>
y2 = lastyear-2
y1 = lastyear-1
print("""
<p>Links to recent expos: <a href="http://expo.survex.com/expedition/%s">last year</a>
<p>Links to recent expos: <a href="http://expo.survex.com/expedition/%s">previous expo</a>
<hr /><table class="fancy">
""" % y1)