From ff2e75cb6b9b05f3d3bbad920c35cfeac6da1db3 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 15 Aug 2008 02:45:19 +0100 Subject: [PATCH] git36 - implement tv-combinedStealFold and tv-combined2B3B --- docs/default.conf | 2 ++ docs/known-bugs-and-planned-features.txt | 2 ++ pyfpdb/fpdb.py | 20 +++++++++++++-- pyfpdb/fpdb_db.py | 24 +++++++++--------- pyfpdb/table_viewer.py | 32 ++++++++++++++++++++---- 5 files changed, 61 insertions(+), 19 deletions(-) diff --git a/docs/default.conf b/docs/default.conf index dadf6290..d2e095d8 100644 --- a/docs/default.conf +++ b/docs/default.conf @@ -3,6 +3,8 @@ db-host=localhost db-databaseName=fpdb db-user=fpdb db-password=enterYourPwHere +tv-combinedStealFold=True +tv-combined2B3B=True tv-combinedPostflop=True bulkImport-defaultPath=default tv-defaultPath=default diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index 83c476a2..1e94e9be 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -3,6 +3,7 @@ Everything is subject to change and especially the order will often change. Patc alpha2 (release by 17Aug) ====== +make table drops depending on previous db version move version into seperate file for fpdb gui and db 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 @@ -30,6 +31,7 @@ fix bug that sawFlop/Turn/River gets miscalculated if someone is allin - might a before beta =========== gentoo ebuild: USE postgresql +skins optionally combine FB/FS and CB/2B/3B 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. diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index e48bac7d..1cdbf39e 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -245,6 +245,8 @@ class fpdb: self.settings['os']="linuxmac" else: self.settings['os']="windows" + self.settings['tv-combinedStealFold']=True + self.settings['tv-combined2B3B']=True if self.settings['os']=="windows": self.settings['bulkImport-defaultPath']="C:\\Program Files\\PokerStars\\HandHistory\\filename.txt" @@ -269,12 +271,26 @@ class fpdb: self.settings['tv-combinedPostflop']=True else: self.settings['tv-combinedPostflop']=False + elif lines[i].startswith("tv-combinedStealFold="): + if lines[i].find("True")!=-1: + self.settings['tv-combinedStealFold']=True + else: + self.settings['tv-combinedStealFold']=False + elif lines[i].startswith("tv-combined2B3B="): + if lines[i].find("True")!=-1: + self.settings['tv-combined2B3B']=True + else: + self.settings['tv-combined2B3B']=False elif lines[i].startswith("bulkImport-defaultPath="): if lines[i][23:-1]!="default": self.settings['bulkImport-defaultPath']=lines[i][23:-1] elif lines[i].startswith("tv-defaultPath="): if lines[i][15:-1]!="default": self.settings['tv-defaultPath']=lines[i][15:-1] + elif lines[i].startswith("#"): + pass #comment - dont parse + else: + raise fpdb_simple.FpdbError("invalid line in profile file: "+lines[i]) if self.db!=None: self.db.disconnect() @@ -347,9 +363,9 @@ 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+, git35") + self.window.set_title("Free Poker DB - version: alpha1+, git36") self.window.set_border_width(1) - self.window.set_size_request(950,400) + self.window.set_size_request(1020,400) self.window.set_resizable(True) self.menu_items = ( diff --git a/pyfpdb/fpdb_db.py b/pyfpdb/fpdb_db.py index cc817678..b065b43b 100755 --- a/pyfpdb/fpdb_db.py +++ b/pyfpdb/fpdb_db.py @@ -87,18 +87,18 @@ class fpdb_db: def drop_tables(self): """Drops the fpdb tables from the current db""" #todo: run the below if current db is git34 or lower - #self.cursor.execute("DROP TABLE IF EXISTS settings;") - #self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;") - #self.cursor.execute("DROP TABLE IF EXISTS autorates;") - #self.cursor.execute("DROP TABLE IF EXISTS board_cards;") - #self.cursor.execute("DROP TABLE IF EXISTS hands_actions;") - #self.cursor.execute("DROP TABLE IF EXISTS hands_players;") - #self.cursor.execute("DROP TABLE IF EXISTS hands;") - #self.cursor.execute("DROP TABLE IF EXISTS tourneys_players;") - #self.cursor.execute("DROP TABLE IF EXISTS tourneys;") - #self.cursor.execute("DROP TABLE IF EXISTS players;") - #self.cursor.execute("DROP TABLE IF EXISTS gametypes;") - #self.cursor.execute("DROP TABLE IF EXISTS sites;") + self.cursor.execute("DROP TABLE IF EXISTS settings;") + self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;") + self.cursor.execute("DROP TABLE IF EXISTS autorates;") + self.cursor.execute("DROP TABLE IF EXISTS board_cards;") + self.cursor.execute("DROP TABLE IF EXISTS hands_actions;") + self.cursor.execute("DROP TABLE IF EXISTS hands_players;") + self.cursor.execute("DROP TABLE IF EXISTS hands;") + self.cursor.execute("DROP TABLE IF EXISTS tourneys_players;") + self.cursor.execute("DROP TABLE IF EXISTS tourneys;") + self.cursor.execute("DROP TABLE IF EXISTS players;") + self.cursor.execute("DROP TABLE IF EXISTS gametypes;") + self.cursor.execute("DROP TABLE IF EXISTS sites;") self.cursor.execute("DROP TABLE IF EXISTS Settings;") self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;") diff --git a/pyfpdb/table_viewer.py b/pyfpdb/table_viewer.py index 47f37fce..e4686a17 100755 --- a/pyfpdb/table_viewer.py +++ b/pyfpdb/table_viewer.py @@ -59,11 +59,25 @@ 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", "CB", "2B", "3B") + tmp=("Name", "Hands", "VPIP", "PFR", "PF3B4B", "ST") + + if self.settings['tv-combinedStealFold']: + tmp+=("FSB", ) + else: + tmp+=("FS", "FB") + + tmp+=("CB", ) + + if self.settings['tv-combined2B3B']: + tmp+=("23B", ) + else: + tmp+=("2B", "3B") + if self.settings['tv-combinedPostflop']: 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") @@ -111,12 +125,20 @@ class table_viewer (threading.Thread): 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 + + if self.settings['tv-combinedStealFold']: + tmp.append(self.hudDivide(row[29]+row[27],row[28]+row[26])+" ("+str(row[28]+row[26])+")") #FSB + else: + 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-combined2B3B']: + tmp.append(self.hudDivide(row[33]+row[35],row[32]+row[34])+" ("+str(row[32]+row[34])+")") #23B + else: + 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]