From 61d0857a4c867807b26b57533f6d9c4bbac9324b Mon Sep 17 00:00:00 2001
From: steffen123
float
As wonWhenSeenFlop, but for showdown.
stealAttemptChance
int
int
Player folded SB to steal attempt
contBetChance
int
Player had chance to make continuation bet
contBetDone
int
Player used chance to make continuation bet
secondBarrelChance
int
Player had chance to make second barrel bet
secondBarrelDone
int
Player used chance to make second barrel bet
thirdBarrelChance
int
Player had chance to make third barrel bet
thirdBarrelDone
int
Player used chance to make third barrel bet
Table hands_actions
diff --git a/packaging/fpdb-1.0_alpha1_p27.ebuild b/packaging/fpdb-1.0_alpha1_p27.ebuild new file mode 100644 index 00000000..e0ec86f6 --- /dev/null +++ b/packaging/fpdb-1.0_alpha1_p27.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-util/fpdb/fpdb-1.0_alpha1_p27.ebuild,v 1.0 2008/08/13 05:45:00 jer Exp $ + +NEED_PYTHON=2.3 + +#inherit distutils + +MY_P="fpdb-${PV}" +DESCRIPTION="A database program to track your online poker games" +HOMEPAGE="https://sourceforge.net/projects/fpdb/" +SRC_URI="mirror://sourceforge/fpdb/fpdb-alpha1-git27.tar.bz2" + +LICENSE="AGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +#note: I would be very surprised if this doesnt work on other architectures, please send me your experiences +IUSE="" + +RDEPEND="virtual/mysql + dev-python/mysql-python + >=x11-libs/gtk+-2.10 + dev-python/pygtk" +DEPEND="${RDEPEND}" + +src_install() { + DIRINST="${D}usr/share/games/fpdb/" + mkdir -p "${DIRINST}" + cp -R * "${DIRINST}" || die + + DIRBIN="${D}usr/bin/games/" + mkdir -p "${DIRBIN}" + #echo "dirs" + #echo "${DIRINST}pyfpdb/fpdb.py" + #echo + ln -s "${DIRINST}pyfpdb/fpdb.py" "${DIRBIN}/fpdb.py" || die +} diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 2e8038f7..e61cbffb 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -347,7 +347,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) - self.window.set_title("Free Poker DB - version: alpha1+, git31") + self.window.set_title("Free Poker DB - version: alpha1+, git33") self.window.set_border_width(1) self.window.set_size_request(950,400) self.window.set_resizable(True) diff --git a/pyfpdb/fpdb_db.py b/pyfpdb/fpdb_db.py index 23c6b287..221d0714 100755 --- a/pyfpdb/fpdb_db.py +++ b/pyfpdb/fpdb_db.py @@ -47,7 +47,7 @@ class fpdb_db: try: self.cursor.execute("SELECT * FROM settings") settings=self.cursor.fetchone() - if settings[0]!=30: + if settings[0]!=33: print "outdated database version - please recreate tables" except:# _mysql_exceptions.ProgrammingError: print "failed to read settings table - please recreate tables" @@ -274,14 +274,22 @@ class fpdb_db: otherRaisedRiverFold INT, wonWhenSeenFlop FLOAT, wonAtSD FLOAT, + stealAttemptChance INT, stealAttempted INT, foldBbToStealChance INT, foldedBbToSteal INT, foldSbToStealChance INT, - foldedSbToSteal INT)""") + foldedSbToSteal INT, - self.cursor.execute("INSERT INTO settings VALUES (30);") + contBetChance INT, + contBetDone INT, + secondBarrelChance INT, + secondBarrelDone INT, + thirdBarrelChance INT, + thirdBarrelDone INT)""") + + self.cursor.execute("INSERT INTO settings VALUES (33);") self.cursor.execute("INSERT INTO sites VALUES (DEFAULT, \"Full Tilt Poker\", 'USD');") self.cursor.execute("INSERT INTO sites VALUES (DEFAULT, \"PokerStars\", 'USD');") self.db.commit() diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index a65ea744..986a9eb2 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1249,10 +1249,6 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings wonAtSD=[] stealAttemptChance=[] stealAttempted=[] - foldBbToStealChance=[] - foldedBbToSteal=[] - foldSbToStealChance=[] - foldedSbToSteal=[] firstPfRaiseByNo=-1 firstPfRaiserId=-1 @@ -1487,6 +1483,10 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings result['stealAttempted']=stealAttempted #after having calculated the above we now do second level calculations, so far just steal attempts. + foldBbToStealChance=[] + foldedBbToSteal=[] + foldSbToStealChance=[] + foldedSbToSteal=[] for player in range (len(player_ids)): myFoldBbToStealChance=False myFoldedBbToSteal=False @@ -1515,6 +1515,48 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings result['foldSbToStealChance']=foldSbToStealChance result['foldedSbToSteal']=foldedSbToSteal + #now CB/2B/3B + contBetChance=[] + contBetDone=[] + for player in range (len(player_ids)): + myContBetChance=False + myContBetDone=False + + #calc CB + + contBetChance.append(myContBetChance) + contBetDone.append(myContBetDone) + result['contBetChance']=contBetDone + result['contBetDone']=contBetDone + + #now 2B + secondBarrelChance=[] + secondBarrelDone=[] + for player in range (len(player_ids)): + mySecondBarrelChance=False + mySecondBarrelDone=False + + #calc 2b + + secondBarrelChance.append(mySecondBarrelChance) + secondBarrelDone.append(mySecondBarrelDone) + result['secondBarrelChance']=secondBarrelDone + result['secondBarrelDone']=secondBarrelDone + + #now 3B + thirdBarrelChance=[] + thirdBarrelDone=[] + for player in range (len(player_ids)): + myThirdBarrelChance=False + myThirdBarrelDone=False + + #calc 3b + + thirdBarrelChance.append(myThirdBarrelChance) + thirdBarrelDone.append(myThirdBarrelDone) + result['thirdBarrelChance']=thirdBarrelDone + result['thirdBarrelDone']=thirdBarrelDone + return result #end def calculateHudImport @@ -1574,16 +1616,23 @@ def storeHudData(cursor, category, gametypeId, playerIds, hudImportData): if hudImportData['foldSbToStealChance'][player]: row[28]+=1 if hudImportData['foldedSbToSteal'][player]: row[29]+=1 + if hudImportData['contBetChance'][player]: row[30]+=1 + if hudImportData['contBetDone'][player]: row[31]+=1 + if hudImportData['secondBarrelChance'][player]: row[32]+=1 + if hudImportData['secondBarrelDone'][player]: row[33]+=1 + if hudImportData['thirdBarrelChance'][player]: row[34]+=1 + if hudImportData['thirdBarrelDone'][player]: row[35]+=1 + if doInsert: #print "playerid before insert:",row[2] cursor.execute("""INSERT INTO HudDataHoldemOmaha - (gametypeId, playerId, activeSeats, HDs, VPIP, PFR, PF3B4BChance, PF3B4B, sawFlop, sawTurn, sawRiver, sawShowdown, raisedFlop, raisedTurn, raisedRiver, otherRaisedFlop, otherRaisedFlopFold, otherRaisedTurn, otherRaisedTurnFold, otherRaisedRiver, otherRaisedRiverFold, wonWhenSeenFlop, wonAtSD, stealAttemptChance, stealAttempted, foldBbToStealChance, foldedBbToSteal, foldSbToStealChance, foldedSbToSteal) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", (row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29])) + (gametypeId, playerId, activeSeats, HDs, VPIP, PFR, PF3B4BChance, PF3B4B, sawFlop, sawTurn, sawRiver, sawShowdown, raisedFlop, raisedTurn, raisedRiver, otherRaisedFlop, otherRaisedFlopFold, otherRaisedTurn, otherRaisedTurnFold, otherRaisedRiver, otherRaisedRiverFold, wonWhenSeenFlop, wonAtSD, stealAttemptChance, stealAttempted, foldBbToStealChance, foldedBbToSteal, foldSbToStealChance, foldedSbToSteal, contBetChance, contBetDone, secondBarrelChance, secondBarrelDone, thirdBarrelChance, thirdBarrelDone) + VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", (row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[33], row[34], row[35])) else: #print "storing updated hud data line" cursor.execute("""UPDATE HudDataHoldemOmaha - SET HDs=%s, VPIP=%s, PFR=%s, PF3B4BChance=%s, PF3B4B=%s, sawFlop=%s, sawTurn=%s, sawRiver=%s, sawShowdown=%s, raisedFlop=%s, raisedTurn=%s, raisedRiver=%s, otherRaisedFlop=%s, otherRaisedFlopFold=%s, otherRaisedTurn=%s, otherRaisedTurnFold=%s, otherRaisedRiver=%s, otherRaisedRiverFold=%s, wonWhenSeenFlop=%s, wonAtSD=%s, stealAttemptChance=%s, stealAttempted=%s, foldBbToStealChance=%s, foldedBbToSteal=%s, foldSbToStealChance=%s, foldedSbToSteal=%s - WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s""", (row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29], row[1], row[2], row[3])) + SET HDs=%s, VPIP=%s, PFR=%s, PF3B4BChance=%s, PF3B4B=%s, sawFlop=%s, sawTurn=%s, sawRiver=%s, sawShowdown=%s, raisedFlop=%s, raisedTurn=%s, raisedRiver=%s, otherRaisedFlop=%s, otherRaisedFlopFold=%s, otherRaisedTurn=%s, otherRaisedTurnFold=%s, otherRaisedRiver=%s, otherRaisedRiverFold=%s, wonWhenSeenFlop=%s, wonAtSD=%s, stealAttemptChance=%s, stealAttempted=%s, foldBbToStealChance=%s, foldedBbToSteal=%s, foldSbToStealChance=%s, foldedSbToSteal=%s, contBetChance=%s, contBetDone=%s, secondBarrelChance=%s, secondBarrelDone=%s, thirdBarrelChance=%s, thirdBarrelDone=%s + WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s""", (row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[33], row[34], row[35], row[1], row[2], row[3])) else: raise FpdbError("todo") #end def storeHudData diff --git a/pyfpdb/table_viewer.py b/pyfpdb/table_viewer.py index 33af6a78..c68341e2 100755 --- a/pyfpdb/table_viewer.py +++ b/pyfpdb/table_viewer.py @@ -59,9 +59,12 @@ class table_viewer (threading.Thread): arr=[] #first prepare the header row if (self.category=="holdem" or self.category=="omahahi" or self.category=="omahahilo"): - tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "ST", "FS", "FB", "AF", "FF", "AT", "FT", "AR", "FR", "WtSD", "W$wsF", "W$SD") + tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "ST", "FS", "FB", "CB", "2B", "3B") if self.settings['tv-combinedPostflop']: - tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "ST", "FS", "FB", "Postf A", "Postf F", "WtSD", "W$wsF", "W$SD") + tmp+=("Postf A", "Postf F") + else: + tmp+=("AF", "FF", "AT", "FT", "AR", "FR") + tmp+=("WtSD", "W$wsF", "W$SD") else: raise fpdb_simple.FpdbError("reimplement stud") arr.append(tmp) @@ -106,10 +109,15 @@ class table_viewer (threading.Thread): tmp.append(self.hudDivide(row[5],row[4])) #VPIP tmp.append(self.hudDivide(row[6],row[4])) #PFR tmp.append(self.hudDivide(row[8],row[7])+" ("+str(row[7])+")") #PF3B4B + tmp.append(self.hudDivide(row[25],row[24])+" ("+str(row[24])+")") #ST tmp.append(self.hudDivide(row[29],row[28])+" ("+str(row[28])+")") #FS tmp.append(self.hudDivide(row[27],row[26])+" ("+str(row[26])+")") #FB + tmp.append(self.hudDivide(row[31],row[30])+" ("+str(row[30])+")") #CB + tmp.append(self.hudDivide(row[33],row[32])+" ("+str(row[32])+")") #2B + tmp.append(self.hudDivide(row[35],row[34])+" ("+str(row[34])+")") #3B + if self.settings['tv-combinedPostflop']: aggCount=row[13]+row[14]+row[15] handCount=row[9]+row[10]+row[11]