Mercurial > hg > rlgallery-misc
view py/cleandb.py @ 66:6542a7cf826b
Fix links from player pages to the ttyrec archive.
RogueGame.getPlayer() was setting the "name" field to self.uname
instead of the player's name.
Bugs like this are why I need to set up an actual testing server.
author | John "Elwin" Edwards |
---|---|
date | Thu, 06 Aug 2015 17:07:40 -0400 |
parents | 25843238434a |
children |
line wrap: on
line source
#!/usr/bin/python3 # cleandb.py: empty the database in an orderly fashion import rlgall import psycopg2 dbconn = psycopg2.connect("dbname=rlg") dbcur = dbconn.cursor() dbcur.execute("UPDATE games SET offbytes = %s", [0]) for game in rlgall.gamelist: dbcur.execute("DELETE FROM " + game.uname + ";") dbcur.execute("DELETE FROM players;") dbconn.commit() dbcur.close() dbconn.close() exit()