Change the Python module's name back to rlgall.
It is no longer an experimental variant. Using a database as a backend is a settled feature.
This commit is contained in:
parent
b9081d194b
commit
f272772dcb
9 changed files with 14 additions and 12 deletions
|
|
@ -12,7 +12,7 @@ py/ contains various Python scripts.
|
|||
py/recorder.py processes the log files and stores the data in a PostgreSQL
|
||||
database. It should be run periodically by cron.
|
||||
|
||||
py/rlgalldb.py is a module which recorder.py requires. It should be installed
|
||||
py/rlgall.py is a module which recorder.py requires. It should be installed
|
||||
in /lib/python<x.y>/site-packages or the equivalent location.
|
||||
|
||||
web/ contains the static parts of the rlgallery.org website. Note that when
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
# cleandb.py: empty the database in an orderly fashion
|
||||
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
import psycopg2
|
||||
|
||||
dbconn = psycopg2.connect("dbname=rlg")
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import os
|
||||
import psycopg2
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
|
||||
# Contains a dir for everyone who registered
|
||||
everydir = "/var/dgl/dgldir/ttyrec/"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# rlgalldb.py
|
||||
# rlgall.py
|
||||
# Module for the Roguelike Gallery, using a postgres database
|
||||
# Requires Python 3.3
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
# setupdb.py: initializes the database tables used by the rlg system.
|
||||
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
import psycopg2
|
||||
|
||||
webuser = "webserver"
|
||||
|
|
|
|||
10
py/stats.py
Normal file → Executable file
10
py/stats.py
Normal file → Executable file
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import math
|
||||
import psycopg2
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
|
||||
def makeExpPDF(lbd):
|
||||
def lpdf(x):
|
||||
|
|
@ -22,13 +24,13 @@ for game in rlgall.gamelist:
|
|||
total = sum(scores)
|
||||
lbd = float(count) / total
|
||||
cdf = makeExpCDF(lbd)
|
||||
print "{0}: {1} games, average {2}".format(game.name, count, int(1/lbd))
|
||||
print("{0}: {1} games, average {2}".format(game.name, count, int(1/lbd)))
|
||||
for i in range(0, 10000, 1000):
|
||||
actual = len([ s for s in scores if i <= s < i + 1000 ])
|
||||
predicted = (cdf(i + 1000) - cdf(i)) * count
|
||||
print "{0:5}: {1:4} {2}".format(i, actual, predicted)
|
||||
print("{0:5}: {1:4} {2}".format(i, actual, predicted))
|
||||
high = max(scores)
|
||||
print "Max: {0} {1}\n".format(high, 1 - cdf(high))
|
||||
print("Max: {0} {1}\n".format(high, 1 - cdf(high)))
|
||||
|
||||
cur.close()
|
||||
conn.close()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import time
|
|||
import calendar
|
||||
from datetime import datetime
|
||||
import pytz
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
#import cgitb
|
||||
|
||||
#cgitb.enable()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import sys
|
||||
import time
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
|
||||
# It is assumed that sys.stdout uses UTF-8 encoding. If this is not the case,
|
||||
# configure the Web server to set the LC_CTYPE environment variable to a UTF-8
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
import rlgalldb as rlgall
|
||||
import rlgall
|
||||
|
||||
playerdir = "/var/www/lighttpd/scoring/players/"
|
||||
linkstr = '<li><a href="./{0}.html">{0}</a></li>\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue