From 8e8444d8f20433fefe8aea0a518bcdc55ba7f036 Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Sat, 27 Feb 2010 16:59:00 -0500 Subject: [PATCH 1/8] Comment out intermediate print. --- pyfpdb/XTables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/XTables.py b/pyfpdb/XTables.py index 28737002..29a9b1d9 100644 --- a/pyfpdb/XTables.py +++ b/pyfpdb/XTables.py @@ -68,7 +68,7 @@ class Table(Table_Window): window_number = None for listing in os.popen('xwininfo -root -tree').readlines(): if re.search(search_string, listing): - print listing +# print listing mo = re.match('\s+([\dxabcdef]+) (.+):\s\(\"([a-zA-Z.]+)\".+ (\d+)x(\d+)\+\d+\+\d+ \+(\d+)\+(\d+)', listing) self.number = int( mo.group(1), 0) self.width = int( mo.group(4) ) From 6daf2382415a666d470aa75a0ab938c7f1a1158d Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Sun, 28 Feb 2010 22:20:09 -0500 Subject: [PATCH 2/8] Add readme.txt to the exe. --- pyfpdb/py2exe_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/py2exe_setup.py b/pyfpdb/py2exe_setup.py index cf9560af..0db53a40 100644 --- a/pyfpdb/py2exe_setup.py +++ b/pyfpdb/py2exe_setup.py @@ -152,7 +152,7 @@ setup( }, # files in 2nd value in tuple are moved to dir named in 1st value - data_files = [('', ['HUD_config.xml.example', 'Cards01.png', 'logging.conf']) + data_files = [('', ['HUD_config.xml.example', 'Cards01.png', 'logging.conf', '../docs/readme.txt']) ,(dist_dir, [r'..\run_fpdb.bat']) ,( dist_dir + r'\gfx', glob.glob(r'..\gfx\*.*') ) # line below has problem with fonts subdir ('not a regular file') From 444ec73f1dc02c9579c2983f16fb8157127a437a Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Mon, 1 Mar 2010 19:26:45 -0500 Subject: [PATCH 3/8] Update for changes to Tables.Table() call. --- pyfpdb/Tables_Demo.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Tables_Demo.py b/pyfpdb/Tables_Demo.py index 397579e7..92bb1a3c 100755 --- a/pyfpdb/Tables_Demo.py +++ b/pyfpdb/Tables_Demo.py @@ -32,12 +32,16 @@ import gtk import gobject # fpdb/free poker tools modules +import Configuration +from HandHistoryConverter import getTableTitleRe + # get the correct module for the current os if os.name == 'posix': import XTables as Tables elif os.name == 'nt': import WinTables as Tables +config = Configuration.Config() # Main function used for testing if __name__=="__main__": # c = Configuration.Config() @@ -82,11 +86,16 @@ if __name__=="__main__": (tour_no, tab_no) = table_name.split(",", 1) tour_no = tour_no.rstrip() tab_no = tab_no.rstrip() - table = Tables.Table(None, tournament = tour_no, table_number = tab_no) + type = "tour" + table_kwargs = dict(tournament = tour_no, table_number = tab_no) else: # not a tournament print "cash game" table_name = table_name.rstrip() - table = Tables.Table(None, table_name = table_name) + type = "cash" + table_kwargs = dict(table_name = table_name) + + search_string = getTableTitleRe(config, "Full Tilt Poker", type, **table_kwargs) + table = Tables.Table(search_string, **table_kwargs) table.gdk_handle = gtk.gdk.window_foreign_new(table.number) print "table =", table From 4c37877c7fea98e3911cb25280be9f041d22b94c Mon Sep 17 00:00:00 2001 From: Gerko de Roo Date: Tue, 2 Mar 2010 21:44:07 +0100 Subject: [PATCH 4/8] Uncalled bet needs to be subtracted from the collectees. the self.collectees is used in the derived stats. The uncalled part of the bet was added to the players profit. --- pyfpdb/PartyPokerToFpdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index 5fdeae0c..c4f73813 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -260,6 +260,7 @@ class PartyPoker(HandHistoryConverter): for i,v in enumerate(self.collected): if v[0] in self.pot.returned: self.collected[i][1] = Decimal(v[1]) - self.pot.returned[v[0]] + self.collectees[v[0]] -= self.pot.returned[v[0]] return origTotalPot() return totalPot instancemethod = type(hand.totalPot) From 1e11109e1fd5749a86e26668333e443ce27d119e Mon Sep 17 00:00:00 2001 From: Gerko de Roo Date: Tue, 2 Mar 2010 21:55:32 +0100 Subject: [PATCH 5/8] Support for new Hand History format for Party Poker Don't have enough 'old' HH to test --- pyfpdb/PartyPokerToFpdb.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index c4f73813..21344415 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -105,13 +105,20 @@ class PartyPoker(HandHistoryConverter): def guessMaxSeats(self, hand): """Return a guess at max_seats when not specified in HH.""" - mo = self.maxOccSeat(hand) - - if mo == 10: return mo - if mo == 2: return 2 - if mo <= 6: return 6 - # there are 9-max tables for cash and 10-max for tournaments - return 9 if hand.gametype['type']=='ring' else 10 + # Total number of players : 4/6 + re_seats = re.compile("""Total\s+number\s+of\s+players\s+\:\s+\d+.{1}(?P\d+)""" , re.VERBOSE) + try: + m = re_seats.search(hand.handText) + mo = m.groupdict() + mo = _mo['SEATS'] + return mo + except: + mo = self.maxOccSeat(hand) + if mo == 10: return mo + if mo == 2: return 2 + if mo <= 6: return 6 + # there are 9-max tables for cash and 10-max for tournaments + return 9 if hand.gametype['type']=='ring' else 10 def compilePlayerRegexs(self, hand): players = set([player[1] for player in hand.players]) From 4272ee36a266d0b10f9b6667fe89a251ad29ad0b Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Wed, 3 Mar 2010 00:42:13 -0500 Subject: [PATCH 6/8] Change for new HH format. Still work to do here. --- pyfpdb/PartyPokerToFpdb.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index 21344415..356b3984 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -83,8 +83,9 @@ class PartyPoker(HandHistoryConverter): (\(No\sDP\)\s)? \((?PReal|Play)\s+Money\)\s+ # FIXME: check if play money is correct Seat\s+(?P