comparison py/rlgall.py @ 64:86ae333bb4c0

Capitalize the class field in database entries. Some logfiles capitalize it and some don't. It will now appear consistently in the database and any database-derived pages. That does not include recent.cgi, whose eventual status is still undecided.
author John "Elwin" Edwards
date Tue, 23 Jun 2015 11:10:46 -0400
parents ad103f9f2e3a
children 6542a7cf826b
comparison
equal deleted inserted replaced
63:ad103f9f2e3a 64:86ae333bb4c0
499 colspec, valspec) 499 colspec, valspec)
500 # Class variables 500 # Class variables
501 fields = ["name", "score", "class", "xl", "fate", "depth", "endt"] 501 fields = ["name", "score", "class", "xl", "fate", "depth", "endt"]
502 rankfields = ["rank", "score", "name", "class", "xl", "fate", "depth", "endt"] 502 rankfields = ["rank", "score", "name", "class", "xl", "fate", "depth", "endt"]
503 pfields = ["score", "class", "xl", "fate", "depth", "endt"] 503 pfields = ["score", "class", "xl", "fate", "depth", "endt"]
504 def postprocess(self, gamelist):
505 "Enforces consistent capitalization of the class title."
506 for d in gamelist:
507 d["class"] = d["class"].capitalize()
508 Game.postprocess(self, gamelist)
504 def getRecent(self, n=20): 509 def getRecent(self, n=20):
505 return [] 510 return []
506 def getPlayer(self, player): 511 def getPlayer(self, player):
507 "Gets all player's games from the database." 512 "Gets all player's games from the database."
508 qstr = "SELECT endt, score, xl, class, fate, depth FROM " + self.uname + " WHERE name = %s;" 513 qstr = "SELECT endt, score, xl, class, fate, depth FROM " + self.uname + " WHERE name = %s;"