python3 2to3 conversion

This commit is contained in:
Philip Sargent 2020-05-26 01:35:20 +01:00
parent 7223a746bf
commit 07bde0ae9b

View File

@ -56,10 +56,10 @@ for r in lines[1:]:
output += '</td><td>' output += '</td><td>'
if mug: if mug:
if not (os.path.isfile(mug)): if not (os.path.isfile(mug)):
print >> sys.stderr, "ERROR: --------------- mug file does not exist: ", mug print("ERROR: --------------- mug file does not exist: ", mug, file=sys.stderr)
if mug: output += '<a href=%s><img alt=":-)" src="i/mug.png" /></a>' % mug if mug: output += '<a href=%s><img alt=":-)" src="i/mug.png" /></a>' % mug
output += '</td>' output += '</td>'
for y in xrange(len(years)): for y in range(len(years)):
if(years[y]): if(years[y]):
m = str(76 + y)[-2:] m = str(76 + y)[-2:]
if(years[y]=='-1'): if(years[y]=='-1'):
@ -98,7 +98,7 @@ lastyear=1976+1+len([t for t in headcounts_byyear if t > 0]) # no expo in 1986
#<style type="text/css"> #<style type="text/css">
#.didntcave { color: #dd0000 } #.didntcave { color: #dd0000 }
print """ print("""
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -117,9 +117,9 @@ table.fancy td.nonempty { background: #eee }
<!-- DO NOT EDIT THIS DOCUMENT BY HAND! It is automatically generated by "scripts/make-folklist.py" --> <!-- 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> <h1>CUCC members and guests in Austria</br> 1976 to %s</h1>
""" % lastyear """ % lastyear)
print """ print("""
<p>This is a pretty much complete list of all the personnel on %d CUCC <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 was no expo in 1986), together with the total number of
expeditions each has attended and the total number of people on each expedition.</p> expeditions each has attended and the total number of people on each expedition.</p>
@ -150,22 +150,22 @@ times. These include particularly Karl Gaisberger
Gunter Graf, Sepp Gunter Graf, Sepp
Steinberger and Robert Seebacher <a href="i/seebacher2.jpg"><img alt=":-)" Steinberger and Robert Seebacher <a href="i/seebacher2.jpg"><img alt=":-)"
src="i/mug.png" /></a>.</p> src="i/mug.png" /></a>.</p>
""" % len([t for t in headcounts_byyear if t > 0]) """ % len([t for t in headcounts_byyear if t > 0]))
y2 = lastyear-2 y2 = lastyear-2
y1 = lastyear-1 y1 = lastyear-1
print """ 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">last year</a>
<hr /><table class="fancy"> <hr /><table class="fancy">
""" % y1 """ % y1)
print output print(output)
print "<tr><td colspan=4><strong>Expo head count</strong></td>", print("<tr><td colspan=4><strong>Expo head count</strong></td>", end=' ')
for y in headcounts_byyear: for y in headcounts_byyear:
print '<td style="text-align: right">%d</td>' % y, print('<td style="text-align: right">%d</td>' % y, end=' ')
print """ print("""
<td></td></tr> <td></td></tr>
</table> </table>
<hr /> <hr />
@ -174,23 +174,23 @@ print """
taken part in expo altogether (not counting non-combatants or vehicles(!)), taken part in expo altogether (not counting non-combatants or vehicles(!)),
of whom %d have their pictures on the site so far.</p> of whom %d have their pictures on the site so far.</p>
<p>Although few take <a href="/people">such statistics</a> seriously, the most dedicated expoers are """ % (headcount, pics) <p>Although few take <a href="/people">such statistics</a> seriously, the most dedicated expoers are """ % (headcount, pics))
recordholders.sort() recordholders.sort()
recordholders.reverse() recordholders.reverse()
k = 2 k = 2
while recordholders[k + 1][0] == recordholders[k][0]: while recordholders[k + 1][0] == recordholders[k][0]:
k = k + 1 k = k + 1
print "%s (%d expos)," % (recordholders[0][1],recordholders[0][0]) print("%s (%d expos)," % (recordholders[0][1],recordholders[0][0]))
for r in recordholders[1:k]: for r in recordholders[1:k]:
print "%s (%d)," % (r[1],r[0]), print("%s (%d)," % (r[1],r[0]), end=' ')
print """and %s (%d). Julian Todd holds the record for consecutive print("""and %s (%d). Julian Todd holds the record for consecutive
expo attendance (10), (along with Mark Shinwell, but he didn't actually expo attendance (10), (along with Mark Shinwell, but he didn't actually
go caving on all of those visits). A more obscure record of longest gap between expos has been held by various people since 2004 at 13, and then 17, years, but in 2017 was upped to 34 years by Phil Sargent, which is going to be extremely hard to beat!</p>""" % (recordholders[k][1],recordholders[k][0]) go caving on all of those visits). A more obscure record of longest gap between expos has been held by various people since 2004 at 13, and then 17, years, but in 2017 was upped to 34 years by Phil Sargent, which is going to be extremely hard to beat!</p>""" % (recordholders[k][1],recordholders[k][0]))
print """<p>Outside-expo caving happens from time to time, with Becka Lawson, Neil Pacey, Julian Todd and Wookey print("""<p>Outside-expo caving happens from time to time, with Becka Lawson, Neil Pacey, Julian Todd and Wookey
joining various Arge and VfHO trips since about 2000. However, the much talked-about joining various Arge and VfHO trips since about 2000. However, the much talked-about
winter expedition/holiday has still not happened, though there is still a lot 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 to be said for it. With draughts reversed in the cold, top entrances should
@ -201,4 +201,4 @@ remain open all winter.</p>
<hr /> <hr />
</body> </body>
</html>""" </html>""")