Merge branch 'eric'

This commit is contained in:
steffen123 2010-09-09 10:48:36 +02:00
commit c48242c219
4 changed files with 455 additions and 19 deletions

View File

@ -43,8 +43,8 @@ if os.name == 'nt':
import win32api
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
lang = locale.getdefaultlocale()[0][0:2]
if lang == "en":
def _(string): return string
else:
import gettext
@ -78,7 +78,8 @@ class Hud:
# cannot touch the gui
if parent is None: # running from cli ..
self.parent = self
self.parent = parent
else:
self.parent = parent
self.table = table
self.config = config
self.poker_game = poker_game
@ -95,6 +96,7 @@ class Hud:
self.popup_windows = {}
self.aux_windows = []
# configure default font and colors from the configuration
(font, font_size) = config.get_default_font(self.table.site)
self.colors = config.get_default_colors(self.table.site)
self.hud_ui = config.get_hud_ui_parameters()
@ -107,6 +109,7 @@ class Hud:
# do we need to add some sort of condition here for dealing with a request for a font that doesn't exist?
game_params = config.get_game_parameters(self.poker_game)
# if there are AUX windows configured, set them up (Ray knows how this works, if anyone needs info)
if not game_params['aux'] == [""]:
for aux in game_params['aux']:
aux_params = config.get_aux_parameters(aux)
@ -118,14 +121,16 @@ class Hud:
self.creation_attrs = None
def create_mw(self):
# Set up a main window for this this instance of the HUD
win = gtk.Window()
win.set_skip_taskbar_hint(True) # invisible to taskbar
win.set_gravity(gtk.gdk.GRAVITY_STATIC)
win.set_title("%s FPDBHUD" % (self.table.name))
win.set_skip_taskbar_hint(True)
win.set_decorated(False)
win.set_opacity(self.colors["hudopacity"])
win.set_title("%s FPDBHUD" % (self.table.name)) # give it a title that we can easily filter out in the window list when Table search code is looking
win.set_decorated(False) # kill titlebars
win.set_opacity(self.colors["hudopacity"]) # set it to configured hud opacity
win.set_focus(None)
win.set_focus_on_map(False)
win.set_accept_focus(False)
eventbox = gtk.EventBox()
label = gtk.Label(self.hud_ui['label'])
@ -133,6 +138,7 @@ class Hud:
win.add(eventbox)
eventbox.add(label)
# set it to the desired color of the HUD for this site
label.modify_bg(gtk.STATE_NORMAL, self.backgroundcolor)
label.modify_fg(gtk.STATE_NORMAL, self.foregroundcolor)
@ -140,9 +146,11 @@ class Hud:
eventbox.modify_fg(gtk.STATE_NORMAL, self.foregroundcolor)
self.main_window = win
# move it to the table window's X/Y position (0,0 on the table window usually)
self.main_window.move(self.table.x, self.table.y)
# A popup menu for the main window
# This menu code has become extremely long - is there a better way to do this?
menu = gtk.Menu()
killitem = gtk.MenuItem(_('Kill This HUD'))
@ -457,6 +465,13 @@ class Hud:
log.debug("setting self.hud_params[%s] = %s" % (param, style))
def update_table_position(self):
# get table's X/Y position on the desktop, and relocate all of our child windows to accomodate
# In Windows, we can verify the existence of a Window, with win32gui.IsWindow(). In Linux, there doesn't seem to be a
# way to verify the existence of a Window, without trying to access it, which if it doesn't exist anymore, results in a
# big giant X trap and crash.
# People tell me this is a bad idea, because theoretically, IsWindow() could return true now, but not be true when we actually
# use it, but accessing a dead window doesn't result in a complete windowing system shutdown in Windows, whereas it does
# in X. - Eric
if os.name == 'nt':
if not win32gui.IsWindow(self.table.number):
self.parent.kill_hud(self, self.table.name)
@ -465,8 +480,8 @@ class Hud:
return False
# anyone know how to do this in unix, or better yet, trap the X11 error that is triggered when executing the get_origin() for a closed window?
if self.table.gdkhandle is not None:
(x, y) = self.table.gdkhandle.get_origin()
if self.table.x != x or self.table.y != y:
(x, y) = self.table.gdkhandle.get_origin() # In Windows, this call returns (0,0) if it's an invalid window. In X, the X server is immediately killed.
if self.table.x != x or self.table.y != y: # If the current position does not equal the stored position, save the new position, and then move all the sub windows.
self.table.x = x
self.table.y = y
self.main_window.move(x + self.site_params['xshift'], y + self.site_params['yshift'])
@ -487,10 +502,10 @@ class Hud:
return True
def on_button_press(self, widget, event):
if event.button == 1:
if event.button == 1: # if primary button, start movement
self.main_window.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time)
return True
if event.button == 3:
if event.button == 3: # if secondary button, popup our main popup window
widget.popup(None, None, None, event.button, event.time)
return True
return False
@ -543,7 +558,7 @@ class Hud:
self.config.save()
def adj_seats(self, hand, config):
# determine how to adjust seating arrangements, if a "preferred seat" is set in the hud layout configuration
# Need range here, not xrange -> need the actual list
adj = range(0, self.max + 1) # default seat adjustments = no adjustment
# does the user have a fav_seat?
@ -621,7 +636,7 @@ class Hud:
[config.supported_games[self.poker_game].stats[stat].col] = \
config.supported_games[self.poker_game].stats[stat].stat_name
if os.name == "nt":
if os.name == "nt": # we call update_table_position() regularly in Windows to see if we're moving around. See comments on that function for why this isn't done in X.
gobject.timeout_add(500, self.update_table_position)
def update(self, hand, config):
@ -668,9 +683,12 @@ class Hud:
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?
window.window.show_all()
unhidewindow = True
tip = "%s\n%s\n%s, %s" % (statd['screen_name'], number[5], number[3], number[4])
Stats.do_tip(window.e_box[r][c], tip)
if unhidewindow: #and not window.window.visible: # there is no "visible" attribute in gtk.Window, although the docs seem to indicate there should be
window.window.show_all()
unhidewindow = False
def topify_window(self, window):
window.set_focus_on_map(False)
@ -686,7 +704,7 @@ class Stat_Window:
# This handles all callbacks from button presses on the event boxes in
# the stat windows. There is a bit of an ugly kludge to separate single-
# and double-clicks.
self.window.show_all()
self.window.show() #_all()
if event.button == 3: # right button event
newpopup = Popup_window(self.window, self)
@ -745,11 +763,13 @@ class Stat_Window:
self.window = gtk.Window()
self.window.set_decorated(0)
self.window.set_property("skip-taskbar-hint", True)
self.window.set_gravity(gtk.gdk.GRAVITY_STATIC)
self.window.set_title("%s" % seat)
self.window.set_property("skip-taskbar-hint", True)
self.window.set_focus(None) # set gtk default focus widget for this window to None
self.window.set_focus_on_map(False)
self.window.set_accept_focus(False)
grid = gtk.Table(rows = game.rows, columns = game.cols, homogeneous = False)
self.grid = grid

0
pyfpdb/Stats.py Executable file → Normal file
View File

View File

@ -0,0 +1,416 @@
Everleaf Gaming Game #196321235
***** Hand history for game #196321235 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:34:15
Table Cortland XIV
Seat 6 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 12.40 USD )
Seat 2: EricBlade ( $ 5 USD )
Seat 3: gabitzatoade ( $ 5.45 USD )
Seat 5: N0pr3s3n7 ( $ 10.29 USD )
Seat 6: Coolcatcool ( $ 8.30 USD )
zlodeu123: posts small blind [$ 0.05 USD]
EricBlade: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 9h, Qd ]
gabitzatoade folds
N0pr3s3n7 raises [$ 0.35 USD]
Coolcatcool folds
zlodeu123 folds
EricBlade folds
N0pr3s3n7 does not show cards
N0pr3s3n7 wins $ 0.25 USD from main pot
Everleaf Gaming Game #196321319
***** Hand history for game #196321319 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:34:38
Table Cortland XIV
Seat 1 is the button
Total number of players: 5
Seat 1: zlodeu123 ( $ 12.35 USD )
Seat 2: EricBlade ( $ 4.90 USD )
Seat 3: gabitzatoade ( $ 5.45 USD )
Seat 5: N0pr3s3n7 ( $ 10.44 USD )
Seat 6: Coolcatcool ( $ 8.30 USD )
EricBlade: posts small blind [$ 0.05 USD]
gabitzatoade: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ Qd, 9d ]
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 folds
EricBlade raises [$ 0.25 USD]
gabitzatoade folds
EricBlade does not show cards
EricBlade wins $ 0.20 USD from main pot
Everleaf Gaming Game #196321394
***** Hand history for game #196321394 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:34:57
Table Cortland XIV
Seat 2 is the button
Total number of players: 5
Seat 1: zlodeu123 ( $ 12.35 USD )
Seat 2: EricBlade ( $ 5 USD )
Seat 3: gabitzatoade ( $ 5.35 USD )
Seat 4: Miazza ( new player )
Seat 5: N0pr3s3n7 ( $ 10.44 USD )
Seat 6: Coolcatcool ( $ 8.30 USD )
gabitzatoade: posts small blind [$ 0.05 USD]
N0pr3s3n7: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 9c, Ac ]
Coolcatcool folds
zlodeu123 folds
EricBlade raises [$ 0.35 USD]
gabitzatoade calls [$ 0.30 USD]
N0pr3s3n7 folds
** Dealing Flop ** [ 4c, Kh, 6h ]
gabitzatoade checks
EricBlade: bets [$ 0.40 USD]
gabitzatoade calls [$ 0.40 USD]
** Dealing Turn ** [ Qh ]
gabitzatoade checks
Miazza has joined the table
EricBlade checks
** Dealing River ** [ Qd ]
gabitzatoade checks
EricBlade checks
EricBlade shows [ 9c, Ac ] a pair of queens
gabitzatoade shows [ 4s, 4d ] a full house, fours full of queens
gabitzatoade wins $ 1.52 USD from main pot with a full house, fours full of queens [ Qh, Qd, 4s, 4d, 4c ]
Everleaf Gaming Game #196321538
***** Hand history for game #196321538 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:35:34
Table Cortland XIV
Seat 3 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 12.35 USD )
Seat 2: EricBlade ( $ 4.25 USD )
Seat 3: gabitzatoade ( $ 6.12 USD )
Seat 4: Miazza ( $ 5 USD )
Seat 5: N0pr3s3n7 ( $ 10.34 USD )
Seat 6: Coolcatcool ( $ 8.30 USD )
N0pr3s3n7: posts small blind [$ 0.05 USD]
Coolcatcool: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ Kc, Jd ]
zlodeu123 raises [$ 0.35 USD]
EricBlade calls [$ 0.35 USD]
gabitzatoade folds
N0pr3s3n7 folds
Coolcatcool folds
** Dealing Flop ** [ 9s, 3c, Jc ]
zlodeu123: bets [$ 0.60 USD]
EricBlade raises [$ 1.80 USD]
zlodeu123 folds
EricBlade does not show cards
EricBlade wins $ 1.95 USD from main pot
Everleaf Gaming Game #196321707
***** Hand history for game #196321707 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:36:15
Table Cortland XIV
Seat 5 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.40 USD )
Seat 2: EricBlade ( $ 5.25 USD )
Seat 3: gabitzatoade ( $ 6.12 USD )
Seat 4: Miazza ( $ 5 USD )
Seat 5: N0pr3s3n7 ( $ 10.29 USD )
Seat 6: Coolcatcool ( $ 8.20 USD )
Coolcatcool: posts small blind [$ 0.05 USD]
zlodeu123: posts big blind [$ 0.10 USD]
Miazza sits out
** Dealing down cards **
Dealt to EricBlade [ 6d, 3d ]
EricBlade folds
gabitzatoade calls [$ 0.10 USD]
N0pr3s3n7 raises [$ 0.30 USD]
Coolcatcool folds
zlodeu123 folds
gabitzatoade calls [$ 0.20 USD]
** Dealing Flop ** [ 8d, 4d, Td ]
gabitzatoade checks
N0pr3s3n7: bets [$ 0.50 USD]
gabitzatoade folds
N0pr3s3n7 does not show cards
N0pr3s3n7 wins $ 0.72 USD from main pot
Everleaf Gaming Game #196321850
***** Hand history for game #196321850 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:36:52
Table Cortland XIV
Seat 6 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.30 USD )
Seat 2: EricBlade ( $ 5.25 USD )
Seat 3: gabitzatoade ( $ 5.82 USD )
Seat 4: Miazza ( $ 5 USD )
Seat 5: N0pr3s3n7 ( $ 10.71 USD )
Seat 6: Coolcatcool ( $ 8.15 USD )
zlodeu123: posts small blind [$ 0.05 USD]
EricBlade: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ Qh, Qd ]
gabitzatoade folds
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 folds
EricBlade does not show cards
EricBlade wins $ 0.10 USD from main pot
Everleaf Gaming Game #196321947
***** Hand history for game #196321947 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:37:15
Table Cortland XIV
Seat 1 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.30 USD )
Seat 3: gabitzatoade ( $ 5.82 USD )
Seat 4: Miazza ( $ 5 USD )
Seat 5: N0pr3s3n7 ( $ 10.71 USD )
Seat 6: Coolcatcool ( $ 8.15 USD )
EricBlade: posts small blind [$ 0.05 USD]
gabitzatoade: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ Ts, Ks ]
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 folds
EricBlade raises [$ 0.25 USD]
gabitzatoade folds
EricBlade does not show cards
EricBlade wins $ 0.20 USD from main pot
Everleaf Gaming Game #196322013
***** Hand history for game #196322013 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:37:32
Table Cortland XIV
Seat 2 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.40 USD )
Seat 3: gabitzatoade ( $ 5.72 USD )
Seat 4: Miazza ( $ 5 USD )
Seat 5: N0pr3s3n7 ( $ 10.71 USD )
Seat 6: Coolcatcool ( $ 8.15 USD )
gabitzatoade: posts small blind [$ 0.05 USD]
Miazza: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 2c, 4s ]
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 raises [$ 0.35 USD]
EricBlade folds
gabitzatoade calls [$ 0.30 USD]
Miazza folds
** Dealing Flop ** [ Ad, 6d, 6s ]
gabitzatoade checks
zlodeu123: bets [$ 0.60 USD]
gabitzatoade calls [$ 0.60 USD]
** Dealing Turn ** [ Jc ]
gabitzatoade checks
zlodeu123 checks
** Dealing River ** [ Th ]
gabitzatoade checks
zlodeu123 checks
zlodeu123 shows [ Ah, 8d ] two pairs, aces and sixes
gabitzatoade shows [ Ac, 9c ] two pairs, aces and sixes
gabitzatoade wins $ 0.95 USD from main pot with two pairs, aces and sixes [ Ac, Ad, Jc, 6d, 6s ]
zlodeu123 wins $ 0.95 USD from main pot with two pairs, aces and sixes [ Ah, Ad, Jc, 6d, 6s ]
Everleaf Gaming Game #196322188
***** Hand history for game #196322188 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:38:16
Table Cortland XIV
Seat 3 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.40 USD )
Seat 3: gabitzatoade ( $ 5.72 USD )
Seat 4: Miazza ( $ 4.90 USD )
Seat 5: N0pr3s3n7 ( $ 10.71 USD )
Seat 6: Coolcatcool ( $ 8.15 USD )
Miazza: posts small blind [$ 0.05 USD]
N0pr3s3n7: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 7d, Kd ]
Coolcatcool folds
zlodeu123 folds
EricBlade raises [$ 0.35 USD]
gabitzatoade folds
Miazza folds
N0pr3s3n7 folds
EricBlade does not show cards
EricBlade wins $ 0.25 USD from main pot
Everleaf Gaming Game #196322268
***** Hand history for game #196322268 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:38:34
Table Cortland XIV
Seat 4 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.55 USD )
Seat 3: gabitzatoade ( $ 5.72 USD )
Seat 4: Miazza ( $ 4.85 USD )
Seat 5: N0pr3s3n7 ( $ 10.61 USD )
Seat 6: Coolcatcool ( $ 8.15 USD )
N0pr3s3n7: posts small blind [$ 0.05 USD]
Coolcatcool: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 6d, Kc ]
zlodeu123 folds
EricBlade folds
gabitzatoade folds
Miazza raises [$ 0.35 USD]
N0pr3s3n7 folds
Coolcatcool raises [$ 0.50 USD]
Miazza folds
Coolcatcool does not show cards
Coolcatcool wins $ 0.75 USD from main pot
Everleaf Gaming Game #196322353
***** Hand history for game #196322353 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:38:57
Table Cortland XIV
Seat 5 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.55 USD )
Seat 3: gabitzatoade ( $ 5.72 USD )
Seat 4: Miazza ( $ 4.50 USD )
Seat 5: N0pr3s3n7 ( $ 10.56 USD )
Seat 6: Coolcatcool ( $ 8.55 USD )
Coolcatcool: posts small blind [$ 0.05 USD]
zlodeu123: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 3h, 9s ]
EricBlade folds
gabitzatoade folds
Miazza folds
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 does not show cards
zlodeu123 wins $ 0.10 USD from main pot
Everleaf Gaming Game #196322422
***** Hand history for game #196322422 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:39:15
Table Cortland XIV
Seat 6 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.30 USD )
Seat 2: EricBlade ( $ 5.55 USD )
Seat 3: gabitzatoade ( $ 5.72 USD )
Seat 4: Miazza ( $ 4.50 USD )
Seat 5: N0pr3s3n7 ( $ 10.56 USD )
Seat 6: Coolcatcool ( $ 8.50 USD )
zlodeu123: posts small blind [$ 0.05 USD]
EricBlade: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ Kd, 4h ]
gabitzatoade folds
Miazza folds
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 folds
EricBlade does not show cards
EricBlade wins $ 0.10 USD from main pot
Everleaf Gaming Game #196322487
***** Hand history for game #196322487 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:39:32
Table Cortland XIV
Seat 1 is the button
Total number of players: 6
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.60 USD )
Seat 3: gabitzatoade ( $ 5.72 USD )
Seat 4: Miazza ( $ 4.50 USD )
Seat 5: N0pr3s3n7 ( $ 10.56 USD )
Seat 6: Coolcatcool ( $ 8.50 USD )
EricBlade: posts small blind [$ 0.05 USD]
gabitzatoade: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ 9h, Th ]
Miazza folds
N0pr3s3n7 folds
Coolcatcool folds
zlodeu123 folds
EricBlade raises [$ 0.25 USD]
gabitzatoade calls [$ 0.20 USD]
** Dealing Flop ** [ 3d, 5d, 6c ]
EricBlade checks
gabitzatoade: bets [$ 0.40 USD]
EricBlade folds
gabitzatoade does not show cards
gabitzatoade wins $ 0.57 USD from main pot
Everleaf Gaming Game #196322581
***** Hand history for game #196322581 *****
Blinds $0.05/$0.10 NL Hold'em - 2010/08/29 - 20:39:58
Table Cortland XIV
Seat 2 is the button
Total number of players: 5
Seat 1: zlodeu123 ( $ 11.25 USD )
Seat 2: EricBlade ( $ 5.30 USD )
Seat 3: gabitzatoade ( $ 5.99 USD )
Seat 4: Miazza ( $ 4.50 USD )
Seat 5: N0pr3s3n7 ( $ 10.56 USD )
Seat 6: SAVCOMP ( new player )
gabitzatoade: posts small blind [$ 0.05 USD]
Miazza: posts big blind [$ 0.10 USD]
** Dealing down cards **
Dealt to EricBlade [ As, 4d ]
N0pr3s3n7 folds
zlodeu123 raises [$ 0.35 USD]
EricBlade folds
gabitzatoade calls [$ 0.30 USD]
SAVCOMP has joined the table
Miazza folds
** Dealing Flop ** [ 3h, 7h, Tc ]
gabitzatoade checks
zlodeu123 checks
** Dealing Turn ** [ Ks ]
gabitzatoade: bets [$ 0.30 USD]
zlodeu123 raises [$ 0.80 USD]
gabitzatoade calls [$ 0.50 USD]
** Dealing River ** [ Ts ]
gabitzatoade: bets [$ 2 USD]
zlodeu123 calls [$ 2 USD]
gabitzatoade shows [ 8s, 7s ] two pairs, tens and sevens
zlodeu123 shows [ Kd, Ad ] two pairs, kings and tens
zlodeu123 wins $ 6.08 USD from main pot with two pairs, kings and tens [ Ad, Kd, Ks, Tc, Ts ]