Mercurial > hg > rlgallery-misc
comparison web/recent.cgi @ 30:e8f3b7994d88
Port to Python 3.
All scripts and modules have been ported to Python 3 and appear to
work. Some changes to the lighttpd configuration were needed.
| author | John "Elwin" Edwards |
|---|---|
| date | Tue, 31 Dec 2013 13:36:19 -0500 |
| parents | 453278a81371 |
| children | 25843238434a |
comparison
equal
deleted
inserted
replaced
| 29:23a769aa487e | 30:e8f3b7994d88 |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python3 |
| 2 # CGI script creating page of recent games | 2 # CGI script creating page of recent games |
| 3 | 3 |
| 4 import sys | 4 import sys |
| 5 import time | 5 import time |
| 6 import rlgalldb as rlgall | 6 import rlgalldb as rlgall |
| 7 | 7 |
| 8 # It is assumed that sys.stdout uses UTF-8 encoding. If this is not the case, | |
| 9 # configure the Web server to set the LC_CTYPE environment variable to a UTF-8 | |
| 10 # locale. | |
| 11 | |
| 8 # The required header | 12 # The required header |
| 9 sys.stdout.write("Content-type: text/html\r\n\r\n") | 13 sys.stdout.write("Content-Type: text/html; charset=utf-8\r\n\r\n") |
| 10 # The top of the page | 14 # The top of the page |
| 11 sys.stdout.write(rlgall.phead.format("Recent Games")) | 15 sys.stdout.write(rlgall.phead.format("Recent Games")) |
| 12 sys.stdout.write(rlgall.ptop); | 16 sys.stdout.write(rlgall.ptop); |
| 13 sys.stdout.write(rlgall.navtop.format("Recent")); | 17 sys.stdout.write(rlgall.navtop.format("Recent")); |
| 14 sys.stdout.write(rlgall.pti.format("Recent Expeditions")) | 18 sys.stdout.write(rlgall.pti.format("Recent Expeditions")) |
