annotate web/recent.cgi @ 95:501ea260724f

Expand the history pages for Super-Rogue and Advanced Rogue 5.
author John "Elwin" Edwards
date Sat, 03 Apr 2021 11:12:36 -0400
parents 25843238434a
children 44e8aaa20d02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
e8f3b7994d88 Port to Python 3.
John "Elwin" Edwards
parents: 21
diff changeset
1 #!/usr/bin/python3
7
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
2 # CGI script creating page of recent games
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
3
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
4 import sys
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
5 import time
33
25843238434a Change the Python module's name back to rlgall.
John "Elwin" Edwards
parents: 30
diff changeset
6 import rlgall
7
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
7
30
e8f3b7994d88 Port to Python 3.
John "Elwin" Edwards
parents: 21
diff changeset
8 # It is assumed that sys.stdout uses UTF-8 encoding. If this is not the case,
e8f3b7994d88 Port to Python 3.
John "Elwin" Edwards
parents: 21
diff changeset
9 # configure the Web server to set the LC_CTYPE environment variable to a UTF-8
e8f3b7994d88 Port to Python 3.
John "Elwin" Edwards
parents: 21
diff changeset
10 # locale.
e8f3b7994d88 Port to Python 3.
John "Elwin" Edwards
parents: 21
diff changeset
11
7
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
12 # The required header
30
e8f3b7994d88 Port to Python 3.
John "Elwin" Edwards
parents: 21
diff changeset
13 sys.stdout.write("Content-Type: text/html; charset=utf-8\r\n\r\n")
7
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
14 # The top of the page
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
15 sys.stdout.write(rlgall.phead.format("Recent Games"))
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
16 sys.stdout.write(rlgall.ptop);
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
17 sys.stdout.write(rlgall.navtop.format("Recent"));
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
18 sys.stdout.write(rlgall.pti.format("Recent Expeditions"))
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
19
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
20 for game in rlgall.gamelist:
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
21 game.tablerecent(sys.stdout)
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
22
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
23 sys.stdout.write(rlgall.pend)
64272fc2350c Begin importing the website.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
24 exit()