""" - Backfill player.ai -> None - Backfill player.game - Backfill game.comments: scalar -> array """ from game import * import sys import pickle # Get all the games dir = sys.argv[1] game_names = [file for file in os.listdir(dir) \ if os.path.isfile("%s/%s" % (dir, file))] print "dir = %s" % dir print "games = ", game_names for game_name in game_names: print "processing %s ..." % game_name f = open('%s/%s' % (dir, game_name), 'r') game = pickle.load(f) f.close() # turn comments into a list game.comments = [game.comments] game.quorum_percent = 50 for player in game.players: # Backfill player.game player.game = game # Backfill player.ai player.ai = None f = open('%s/%s' % (dir, game_name), 'w') pickle.dump(game, f) f.close()