From 2a0f73646cc8439c7ce5e8493f8b2112d21a90dd Mon Sep 17 00:00:00 2001 From: steffen123 Date: Wed, 13 Aug 2008 04:13:56 +0100 Subject: [PATCH] git30 - --- docs/known-bugs-and-planned-features.txt | 12 ++++--- pyfpdb/fpdb.py | 2 +- pyfpdb/fpdb_db.py | 4 +-- pyfpdb/fpdb_simple.py | 42 ++++++++++++++++++------ 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index fcf965a5..fcb3b1f3 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -3,8 +3,7 @@ Everything is subject to change. before alpha2 ============= -fill steal reaction fields -add all steal fields to tester and tv +add steal reaction to tv CB, 2nd/3rd Barrel, fold to these printhand each and the 2/3 relevant printplayerflags respectively on ps-lhe-ring-successful-steal-by-cutoff.txt and ps-lhe-ring-call-3B-preflop-cb-no2b.txt auto-import @@ -16,11 +15,14 @@ delete old mailing list and create fpdb-announce finish updating filelist return sng support -before beta -=========== +alpha3 +====== +anonymiser script to generate testdata without making a dozen find&replace all... remember to replace hand no by running no SD/F, W$wsF, W$@SD too low as reported by daedal in 2+2 forum on 12/13aug show database version error in GUI -anonymiser script to generate testdata without making a dozen find&replace all... + +before beta +=========== separate all gui and all processing into files that are named accordingly ensure that there is only one db handle flying around and that its state is handled properly, ie. by the GUI. i think that might be why we have to reconnect the DB in tableviewer. figure out what slowed it down so much between git19 and git21 (8/9aug) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index b54550ea..ab26977e 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+, git29") + self.window.set_title("Free Poker DB - version: alpha1+, git30") 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 071ac49c..23c6b287 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]!=28: + if settings[0]!=30: print "outdated database version - please recreate tables" except:# _mysql_exceptions.ProgrammingError: print "failed to read settings table - please recreate tables" @@ -281,7 +281,7 @@ class fpdb_db: foldSbToStealChance INT, foldedSbToSteal INT)""") - self.cursor.execute("INSERT INTO settings VALUES (28);") + self.cursor.execute("INSERT INTO settings VALUES (30);") 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 bd89b872..a65ea744 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1287,6 +1287,8 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings sbId=player_ids[player] if positions=='B': bbId=player_ids[player] + + someoneStole=False #run a loop for each player preparing the actual values that will be commited to SQL for player in range (len(player_ids)): @@ -1312,10 +1314,6 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings myWonAtSD=0.0 myStealAttemptChance=False myStealAttempted=False - myFoldBbToStealChance=False - myFoldedBbToSteal=False - myFoldSbToStealChance=False - myFoldedSbToSteal=False #calculate VPIP and PFR street=0 @@ -1365,8 +1363,10 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings myStealAttemptChance=True if positions[player]=='B': pass - - + + if myStealAttempted: + someoneStole=True + #calculate saw* values if (len(action_types[1][player])>0): mySawFlop=True @@ -1462,10 +1462,6 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings wonAtSD.append(myWonAtSD) stealAttemptChance.append(myStealAttemptChance) stealAttempted.append(myStealAttempted) - foldBbToStealChance.append(myFoldBbToStealChance) - foldedBbToSteal.append(myFoldedBbToSteal) - foldSbToStealChance.append(myFoldSbToStealChance) - foldedSbToSteal.append(myFoldedSbToSteal) #add each array to the to-be-returned dictionary result={'VPIP':VPIP} @@ -1489,10 +1485,36 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings result['wonAtSD']=wonAtSD result['stealAttemptChance']=stealAttemptChance result['stealAttempted']=stealAttempted + + #after having calculated the above we now do second level calculations, so far just steal attempts. + for player in range (len(player_ids)): + myFoldBbToStealChance=False + myFoldedBbToSteal=False + myFoldSbToStealChance=False + myFoldedSbToSteal=False + + if someoneStole and (positions[player]=='B' or positions[player]=='S') and firstPfRaiserId!=player_ids[player]: + street=0 + for count in range (len(action_types[street][player])):#finally individual actions + if positions[player]=='B': + myFoldBbToStealChance=True + if action_types[street][player][count]=="fold": + myFoldedBbToSteal=True + if positions[player]=='S': + myFoldSbToStealChance=True + if action_types[street][player][count]=="fold": + myFoldedSbToSteal=True + + + foldBbToStealChance.append(myFoldBbToStealChance) + foldedBbToSteal.append(myFoldedBbToSteal) + foldSbToStealChance.append(myFoldSbToStealChance) + foldedSbToSteal.append(myFoldedSbToSteal) result['foldBbToStealChance']=foldBbToStealChance result['foldedBbToSteal']=foldedBbToSteal result['foldSbToStealChance']=foldSbToStealChance result['foldedSbToSteal']=foldedSbToSteal + return result #end def calculateHudImport