diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 996ef60c..117fd0c7 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -267,6 +267,10 @@ class Game: stat.hudprefix = stat_node.getAttribute("hudprefix") stat.hudsuffix = stat_node.getAttribute("hudsuffix") stat.hudcolor = stat_node.getAttribute("hudcolor") + stat.stat_loth = stat_node.getAttribute("stat_loth") + stat.stat_hith = stat_node.getAttribute("stat_hith") + stat.stat_locolor = stat_node.getAttribute("stat_locolor") + stat.stat_hicolor = stat_node.getAttribute("stat_hicolor") self.stats[stat.stat_name] = stat diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index b1ebd761..3acfd812 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -448,59 +448,61 @@ Left-Drag to Move" - - - - - + + + + - - + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index a18797df..1ea0d203 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -512,7 +512,7 @@ or None if we fail to get the info """ def getTableTitleRe(type, table_name=None, tournament = None, table_number=None): "Returns string to search in windows titles" if type=="tour": - return "%s.+Table\s%s" % (tournament, table_number) + return "%s.+Table.+%s" % (tournament, table_number) else: return table_name diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index b61c17aa..2b6d0237 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -631,6 +631,19 @@ class Hud: if this_stat.hudcolor != "": self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(self.colors['hudfgcolor'])) window.label[r][c].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(this_stat.hudcolor)) + else: + self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(self.colors['hudfgcolor'])) + window.label[r][c].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FFFFFF")) + + if this_stat.stat_loth != "": + if number[0] < (float(this_stat.stat_loth)/100): + self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(self.colors['hudfgcolor'])) + window.label[r][c].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(this_stat.stat_locolor)) + + if this_stat.stat_hith != "": + if number[0] > (float(this_stat.stat_hith)/100): + self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(self.colors['hudfgcolor'])) + window.label[r][c].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(this_stat.stat_hicolor)) window.label[r][c].set_text(statstring) if statstring != "xxx": # is there a way to tell if this particular stat window is visible already, or no? diff --git a/pyfpdb/Tables.py b/pyfpdb/Tables.py index ea5dfc4c..28bd313a 100755 --- a/pyfpdb/Tables.py +++ b/pyfpdb/Tables.py @@ -161,7 +161,7 @@ def discover_posix_by_name(c, tablename): def discover_posix_tournament(c, t_number, s_number): """Finds the X window for a client, given tournament and table nos.""" - search_string = "%s.+Table\s%s" % (t_number, s_number) + search_string = "%s.+Table.+%s" % (t_number, s_number) for listing in os.popen('xwininfo -root -tree').readlines(): if re.search(search_string, listing): return decode_xwininfo(c, listing) diff --git a/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt b/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt new file mode 100644 index 00000000..b876c42a --- /dev/null +++ b/pyfpdb/regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt @@ -0,0 +1,41 @@ +PokerStars Game #37165169101: Hold'em No Limit ($0.10/$0.25 USD) - 2009/12/25 9:50:09 ET +Table 'Lucretia IV' 6-max Seat #2 is the button +Seat 1: Blåveis ($55.10 in chips) +Seat 2: Kinewma ($31.40 in chips) +Seat 3: AAALISAAAA ($20.20 in chips) +Seat 4: Arbaz ($25 in chips) +Seat 5: s0rrow ($29.85 in chips) +Seat 6: bys7 ($41.35 in chips) +AAALISAAAA: posts small blind $0.10 +Arbaz: posts big blind $0.25 +*** HOLE CARDS *** +Dealt to s0rrow [Ac As] +s0rrow: raises $0.50 to $0.75 +bys7: calls $0.75 +Blåveis: folds +Kinewma: folds +AAALISAAAA: raises $1.50 to $2.25 +Arbaz: folds +s0rrow: raises $3.50 to $5.75 +bys7: folds +AAALISAAAA: raises $14.45 to $20.20 and is all-in +s0rrow: calls $14.45 +*** FLOP *** [3d 7h Kh] +*** TURN *** [3d 7h Kh] [Ts] +*** RIVER *** [3d 7h Kh Ts] [5c] +*** SHOW DOWN *** +AAALISAAAA: shows [Kd 5d] (two pair, Kings and Fives) +s0rrow: shows [Ac As] (a pair of Aces) +AAALISAAAA collected $39.35 from pot +*** SUMMARY *** +Total pot $41.40 | Rake $2.05 +Board [3d 7h Kh Ts 5c] +Seat 1: Blåveis folded before Flop (didn't bet) +Seat 2: Kinewma (button) folded before Flop (didn't bet) +Seat 3: AAALISAAAA (small blind) showed [Kd 5d] and won ($39.35) with two pair, Kings and Fives +Seat 4: Arbaz (big blind) folded before Flop +Seat 5: s0rrow showed [Ac As] and lost with a pair of Aces +Seat 6: bys7 folded before Flop + + + diff --git a/pyfpdb/test_PokerStars.py b/pyfpdb/test_PokerStars.py index e3e45c35..18a9f556 100644 --- a/pyfpdb/test_PokerStars.py +++ b/pyfpdb/test_PokerStars.py @@ -82,6 +82,8 @@ def testFlopImport(): # River: hero (continuation bets?) all-in and is not called importer.addBulkImportImportFileOrDir( """regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Stats-comparision.txt""", site="PokerStars") + importer.addBulkImportImportFileOrDir( + """regression-test-files/cash/Stars/Flop/NLHE-6max-USD-0.05-0.10-200912.Allin-pre.txt""", site="PokerStars") importer.setCallHud(False) (stored, dups, partial, errs, ttime) = importer.runImport() print "DEBUG: stored: %s dups: %s partial: %s errs: %s ttime: %s" %(stored, dups, partial, errs, ttime) @@ -114,6 +116,32 @@ and s.id = p.siteid""" # Assert if any sawShowdown = True assert result[row][col['sawShowdown']] == 0 + q = """SELECT + s.name, + p.name, + hp.sawShowdown +FROM + Hands as h, + Sites as s, + Gametypes as g, + HandsPlayers as hp, + Players as p +WHERE + h.siteHandNo = 37165169101 +and g.id = h.gametypeid +and hp.handid = h.id +and p.id = hp.playerid +and s.id = p.siteid""" + c = db.get_cursor() + c.execute(q) + result = c.fetchall() + for row, data in enumerate(result): + print "DEBUG: result[%s]: %s" %(row, result[row]) + # Assert if any sawShowdown = True + assert result[row][col['sawShowdown']] == 1 + + assert 0 == 1 + def testStudImport(): db.recreate_tables() importer = fpdb_import.Importer(False, settings, config)