From 02204edc48b0708a30bd8ef2ca961c61038bd508 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 10 Dec 2010 21:35:49 +0800 Subject: [PATCH] Give storeHands the ability to output test data Will allow for regression testing of hand start time --- pyfpdb/Database.py | 8 +++++++- pyfpdb/Hand.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 952f2727..7b6bfb4a 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1692,7 +1692,13 @@ class Database: # NEWIMPORT CODE ########################### - def storeHand(self, p): + def storeHand(self, p, printdata = False): + if printdata: + print "######## Hands ##########" + import pprint + pp = pprint.PrettyPrinter(indent=4) + pp.pprint(p) + print "###### End Hands ########" #stores into table hands: q = self.sql.query['store_hand'] diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 2d7088e6..b2e220b1 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -265,7 +265,7 @@ db: a connected Database object""" # seats TINYINT NOT NULL, hh['seats'] = len(self.dbid_pids) - self.dbid_hands = db.storeHand(hh) + self.dbid_hands = db.storeHand(hh, printdata = printtest) self.dbid_hpid = db.storeHandsPlayers(self.dbid_hands, self.dbid_pids, self.stats.getHandsPlayers(), printdata = printtest) if self.saveActions: