Import the web/scoring/ files.
This commit is contained in:
parent
81f7f77450
commit
ffd5e45fd0
3 changed files with 95 additions and 0 deletions
32
web/scoring/players/index.cgi
Executable file
32
web/scoring/players/index.cgi
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import rlgall
|
||||
|
||||
playerdir = "/var/www/lighttpd/scoring/players/"
|
||||
linkstr = '<li><a href="./{0}.html">{0}</a></li>\n'
|
||||
|
||||
filelist = os.listdir(playerdir)
|
||||
namelist = []
|
||||
|
||||
for filename in filelist:
|
||||
if filename.endswith(".html"):
|
||||
namelist.append(filename.rsplit(".html", 1)[0])
|
||||
namelist.sort()
|
||||
|
||||
sys.stdout.write("Content-type: text/html\r\n\r\n")
|
||||
sys.stdout.write(rlgall.phead.format("Players"))
|
||||
sys.stdout.write(rlgall.ptop)
|
||||
sys.stdout.write(rlgall.navscore.format("Players"))
|
||||
sys.stdout.write(rlgall.pti.format("Players"))
|
||||
|
||||
if not namelist:
|
||||
sys.stdout.write("<p>No one is here.</p>\n")
|
||||
else:
|
||||
sys.stdout.write("<ul>\n")
|
||||
for name in namelist:
|
||||
sys.stdout.write(linkstr.format(name))
|
||||
sys.stdout.write("</ul>\n")
|
||||
|
||||
sys.stdout.write(rlgall.pend)
|
||||
Loading…
Add table
Add a link
Reference in a new issue