gameover (version 1.7)
index
/var/www/gameover/gameover.py

Mod_python module for keeping scores.

 
Modules
            
cPickle
copy
fcntl
os
random
re
smtplib
string
sys
time
types

 
Classes
            
GenericRequestHandler
GameOverRequestHandler
HtmlPresenter
GameOverHtmlPresenter

 
class GameOverHtmlPresenter(HtmlPresenter)
      HTML presentation layer for tracker and game objects.
 
  
__init__(self, logger=None)
game_page(self, game)
historypage(self, game)
indexpage(self, tracker)
infomsg(self, msg) from HtmlPresenter
make_link(self, msg, main=1, name='', site='', variant='', justthelink=0, anchor=None, subpage=None)
mkhistorytable(self, game, start=0, end=-1, startdate=None, enddate=None)
Returns a table showing the game history
 
Start and end are game indexes to start and end the history 
table (index starts at 0 with oldest recorded score).
If end == -1, then end is the last element in the history. Otherwise, 
history up to but not including the end'th row will be returned.
Another method to specify start and end is to specify dates, as
unix times.
warning(self, msg) from HtmlPresenter

 
class GameOverRequestHandler(GenericRequestHandler)
      Mod_python handler layer.
 
  
__init__(self)
about_cgi(self, req, reqparams, fields)
addgame_cgi(self, req, reqparams, fields)
addscores_cgi(self, req, reqparams, fields)
check_form_inputs(self, fields, names=[]) from GenericRequestHandler
check_game_password(self, fields, admin=0)
check_sane_name(self, string) from GenericRequestHandler
checkfiles(self, mineonly=0) from GenericRequestHandler
deletegame_cgi(self, req, reqparams, fields)
doc_cgi(self, req, reqparams, fields)
gameadmin_cgi(self, req, reqparams, fields)
gen_random_token(self) from GenericRequestHandler
graph_cgi(self, req, reqparams, fields)
history_cgi(self, req, reqparams, fields)
index_cgi(self, req, reqparams, fields)
Serve out the main page, or call game_page to serve a game page.
maindispatcher(self, req) from GenericRequestHandler
make_string_sane(self, string) from GenericRequestHandler
process_gameadmin_form(self, fields, gameobj)
process_scores_form(self, fields, gameobj)
send_confirm_email(self, toaddr, subject, body) from GenericRequestHandler
val_cgi(self, req, reqparams, fields)
Processes the email validation url clicks.

 
class GenericRequestHandler
       
  
__init__(self)
check_form_inputs(self, fields, names=[])
check_sane_name(self, string)
checkfiles(self, mineonly=0)
gen_random_token(self)
maindispatcher(self, req)
make_string_sane(self, string)
send_confirm_email(self, toaddr, subject, body)

 
class HtmlPresenter
       
  
__init__(self, logger=None)
infomsg(self, msg)
warning(self, msg)

 
Functions
            
handler(req)
migrate()
Migrate saved data from older versions.

 
Data
             __file__ = './gameover.py'
__header__ = '$Header: /home/esj/trav/cvsroot/gameover/gameover.html,v 1.8 2005/06/08 17:21:19 esj Exp $'
__name__ = 'gameover'
__version__ = '$Revision: 1.8 $'
baseurl = 'http://strange.wwd.ca/gameover'
data_dir = '/var/www/gameover/data'
forms = {'add_game': '\n\t\t<form action="http://strange.wwd.ca/gameover/...ired entry.</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t', 'change_game': '\n\t\t<h2><a name="gameadmin"></a>Game Administrati...</button></td></tr>\n\t\t</table>\n\t\t</form></div>\n\t\t', 'gamelistitem': '\n\t\t<tr><td><input type="checkbox" name="delete%(...amp;variant=%(variant)s">\n\t\tshow</a></td></tr>\n\t\t', 'new_score': '\n\t\t<tr><th>%(pname)s</th><td> won </td>\n\t\t<td><i...ent%(pidx)d">%(opplist)s\n\t\t</select></td></tr>\n\t\t', 'playerdata': '\n\t\t<tr><td>%(name)s</td>\n\t\t\t<td><input type="che...pe="checkbox" name="p%(idx)ddel"></td>\n\t\t</tr>\n\t\t', 'playerranking': '\n\t\t<tr><td>%(n)s</td>\n\t\t<td>%(r)d</td><td>%(tw)d</td><td>%(tl)d</td><td>%(td)d</td>\n\t\t</tr>\n\t\t', 'rankingtable': '\n\t\t<table class="rankings"><tr><th>Name</th><th>...mes played are not shown.</td></tr>\n\t\t</table>\n\t\t', 'wins_table_line': '\n\t\t<tr class="%(class)s"><th>%(wn)s</th>\n\t\t<td> ...ln)s</td>\n\t\t<td> on </td><td> %(d)s </td></tr>\n\t\t'}
installed_dir = '/var/www/gameover'
logger = <gameover_app.BasicLogger instance>
runningunderapache = 0
site_password = 'yoyo'
smtpfrom = 'nospamming!@wwd.ca'
smtphost = 'localhost'
smtpport = 25
text = {'add_game': '\n\t\t<h2>Add Game</h2>\n\t\t<h3>Anyone can add a game...ministrator, do not\n\t\tenter anything here.</li>\n\t', 'gamepagelinks': '<table class="gamepagelinks"><tr>\n\t\t<td class="g...ameadmin">admin stuff</a></td>\n\t\t</tr></table>\n\t\t', 'list_of_games': '\n\t\t<form action="http://strange.wwd.ca/gameover/...bmit">\n\t\tDelete selected games</button></form>\n\t\t', 'title': '\n\t\t<table class="titleblock">\n\t\t<tr><td colspan=...ver@e.wwd.ca">contact</a></td>\n\t\t</tr></table>\n\t\t', 'valemail-html': '<html><body>\n\t\t <h3>Hello, this is GameOver!, a ...(baseurl)s">%(baseurl)s</a></p>\n\t\t </body></html>', 'valemail-txt': 'Hello, this is GameOver!, a website for keeping ...n on GameOver!, see the main page at\n\t%(baseurl)s'}
version = '0.99'