git33 - added fields for CB/2B/3B to table design, table creation and tv. importer fills it with placeholder data
renamed ebuild from v0.01 alpha to v1.0 alpha as I won't be using normal version numbers before 1.0
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
+11
-3
@@ -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()
|
||||
|
||||
+57
-8
@@ -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
|
||||
|
||||
+10
-2
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user