From 1d0177f6d47a93666f642334aa9438960c2475b8 Mon Sep 17 00:00:00 2001 From: Worros Date: Tue, 13 Oct 2009 14:04:19 +0800 Subject: [PATCH] [NEWIMPORT] Finish up Hand import Decided to leave streetXRaisesN alone for the moment --- pyfpdb/Database.py | 25 +++++++++++++------------ pyfpdb/DerivedStats.py | 28 +++++++++------------------- pyfpdb/fpdb.py | 0 3 files changed, 22 insertions(+), 31 deletions(-) mode change 100644 => 100755 pyfpdb/fpdb.py diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index e05a38b8..60ce39aa 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1391,6 +1391,7 @@ class Database: importtime, seats, maxseats, + texture, playersVpi, boardcard1, boardcard2, @@ -1402,6 +1403,11 @@ class Database: playersAtStreet3, playersAtStreet4, playersAtShowdown, + street0Raises, + street1Raises, + street2Raises, + street3Raises, + street4Raises, street1Pot, street2Pot, street3Pot, @@ -1411,13 +1417,7 @@ class Database: VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, - %s, %s, %s)""" -#--- texture, -#-- street0Raises, -#-- street1Raises, -#-- street2Raises, -#-- street3Raises, -#-- street4Raises, + %s, %s, %s, %s, %s, %s, %s, %s, %s)""" q = q.replace('%s', self.sql.query['placeholder']) print "DEBUG: p: %s" %p @@ -1430,6 +1430,7 @@ class Database: datetime.today(), #importtime p['seats'], p['maxSeats'], + p['texture'], p['playersVpi'], p['boardcard1'], p['boardcard2'], @@ -1441,11 +1442,11 @@ class Database: p['playersAtStreet3'], p['playersAtStreet4'], p['playersAtShowdown'], -# hudCache['street0Raises'], -# hudCache['street1Raises'], -# hudCache['street2Raises'], -# hudCache['street3Raises'], -# hudCache['street4Raises'], + p['street0Raises'], + p['street1Raises'], + p['street2Raises'], + p['street3Raises'], + p['street4Raises'], p['street1Pot'], p['street2Pot'], p['street3Pot'], diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 7d428be9..fa85df14 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -47,6 +47,7 @@ class DerivedStats(): self.hands['importTime'] = None self.hands['seats'] = self.countPlayers(hand) self.hands['maxSeats'] = hand.maxseats + self.hands['texture'] = None # No calculation done for this yet. # This (i think...) is correct for both stud and flop games, as hand.board['street'] disappears, and # those values remain default in stud. @@ -66,27 +67,11 @@ class DerivedStats(): self.hands['street4Pot'], self.hands['showdownPot']) = hand.getStreetTotals() - self.vpip(hand) # Gives playersVpi (num of players vpip) self.playersAtStreetX(hand) # Gives playersAtStreet1..4 and Showdown - # texture smallint, - - # street0Raises TINYINT NOT NULL, /* num small bets paid to see flop/street4, including blind */ - # Needs to be recorded - # street1Raises TINYINT NOT NULL, /* num small bets paid to see turn/street5 */ - # Needs to be recorded - # street2Raises TINYINT NOT NULL, /* num big bets paid to see river/street6 */ - # Needs to be recorded - # street3Raises TINYINT NOT NULL, /* num big bets paid to see sd/street7 */ - # Needs to be recorded - # street4Raises TINYINT NOT NULL, /* num big bets paid to see showdown */ - # Needs to be recorded - - # comment TEXT, - # commentTs DATETIME - - + # comment TEXT, + # commentTs DATETIME def assembleHandsPlayers(self, hand): self.vpip(self.hand) @@ -145,7 +130,12 @@ class DerivedStats(): # [ (player, action, ....), (player2, action, ...) ] # No idea what this value is actually supposed to be # In theory its "num small bets paid to see flop/street4, including blind" which makes sense for limit. Not so useful for nl - pass + # Leaving empty for the moment, + self.hands['street0Raises'] = 0 # /* num small bets paid to see flop/street4, including blind */ + self.hands['street1Raises'] = 0 # /* num small bets paid to see turn/street5 */ + self.hands['street2Raises'] = 0 # /* num big bets paid to see river/street6 */ + self.hands['street3Raises'] = 0 # /* num big bets paid to see sd/street7 */ + self.hands['street4Raises'] = 0 # /* num big bets paid to see showdown */ def aggr(self, hand, i): aggrers = set() diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py old mode 100644 new mode 100755