From 26eca40b31269714c1cf17f843fede688267e50c Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 2 Sep 2010 00:19:31 +0800 Subject: [PATCH] More HandsActions stubbing --- pyfpdb/Database.py | 10 +++++++++- pyfpdb/DerivedStats.py | 12 ++++++++---- pyfpdb/SQL.py | 13 +++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index c9591889..88678136 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1782,7 +1782,15 @@ class Database: # adata[p]['sitout'], # adata[p]['card1'], - #q = self.sql.query['store_hands_actions'] + #handsPlayerId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (handsPlayerId) REFERENCES HandsPlayers(id), + #street SMALLINT NOT NULL, + #actionNo SMALLINT NOT NULL, + #action CHAR(5) NOT NULL, + #allIn BOOLEAN NOT NULL, + #amount INT NOT NULL, + + + q = self.sql.query['store_hands_actions'] #q = q.replace('%s', self.sql.query['placeholder']) #print "DEBUG: inserts: %s" %inserts diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 40646342..1172d1f0 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -97,10 +97,12 @@ class DerivedStats(): self.assembleHandsActions(self.hand) if DEBUG: - print "Hands:" - pp.pprint(self.hands) - print "HandsPlayers:" - pp.pprint(self.handsplayers) + #print "Hands:" + #pp.pprint(self.hands) + #print "HandsPlayers:" + #pp.pprint(self.handsplayers) + print "HandsActions:" + pp.pprint(self.handsactions) def getHands(self): return self.hands @@ -214,6 +216,8 @@ class DerivedStats(): # Squeeze, Ratchet? def assembleHandsActions(self, hand): + print "DEBUG: hand.actions" + pp.pprint(hand.actions) pass def setPositions(self, hand): diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 57eb8c35..abc812a8 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -4221,6 +4221,19 @@ class Sql: %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )""" + + self.query['store_hands_actions'] = """INSERT INTO HandsActions ( + handsPlayerId, + street, + actionNo, + action, + allIn, + amount + ) + VALUES ( + %s, %s, %s, %s, %s, + %s + )""" ################################ # Counts for DB stats window