From cf1efb8d27cf3f1e2a03d25a71fe1af0c2a72e84 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 5 Nov 2008 22:44:29 -0500 Subject: [PATCH 1/3] transaction isolation code suggested by sql_coder on the forums --- pyfpdb/Database.py | 4 ++++ pyfpdb/HUD_main.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 63de54b2..4039b256 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -59,6 +59,10 @@ class Database: user = c.supported_databases[db_name].db_user, passwd = c.supported_databases[db_name].db_pass, db = c.supported_databases[db_name].db_name) + cur_iso = self.connection.cursor() + cur_iso.execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED') + cur_iso.close() + except: print "Error opening database connection %s. See error log file." % (file) traceback.print_exc(file=sys.stderr) diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index a157cf46..b1955a6b 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -89,6 +89,7 @@ def update_HUD(new_hand_id, table_name, config, stat_dict): def read_stdin(): # This is the thread function global hud_dict + db_connection = Database.Database(config, db_name, 'temp') while True: # wait for a new hand number on stdin new_hand_id = sys.stdin.readline() new_hand_id = string.rstrip(new_hand_id) @@ -101,10 +102,8 @@ def read_stdin(): # This is the thread function del(hud_dict[h]) # connect to the db and get basic info about the new hand - db_connection = Database.Database(config, db_name, 'temp') (table_name, max, poker_game) = db_connection.get_table_name(new_hand_id) stat_dict = db_connection.get_stats_from_hand(new_hand_id) - db_connection.close_connection() # if a hud for this table exists, just update it if hud_dict.has_key(table_name): From c330bd772b6de8a5304bd8629cd116ed009bf517 Mon Sep 17 00:00:00 2001 From: eblade Date: Thu, 6 Nov 2008 06:26:25 -0500 Subject: [PATCH 2/3] add .exe to PokerStars tablefinder in default config, change some things for the "everleaf" entry --- pyfpdb/HUD_config.xml.example | 53 +++++++++++++++-------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index aeeaa219..3a595fe2 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -2,7 +2,7 @@ - + @@ -84,39 +84,30 @@ - - - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + + + + - + - - - - - - - - - - - - + From 27c6c4884edb55bee25cd2deb4b7c0034698b53b Mon Sep 17 00:00:00 2001 From: eblade Date: Thu, 6 Nov 2008 06:58:28 -0500 Subject: [PATCH 3/3] stat popups attach themselves to the stat window as children, have proper colors --- pyfpdb/Hud.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index ebea595a..2712c55b 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -399,6 +399,14 @@ class Popup_window: # need an event box so we can respond to clicks self.window.add(self.ebox) self.ebox.add(self.lab) + + self.ebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudbgcolor'])) + self.ebox.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudfgcolor'])) + self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudbgcolor'])) + self.window.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudfgcolor'])) + self.lab.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudbgcolor'])) + self.lab.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudfgcolor'])) + self.window.realize # figure out the row, col address of the click that activated the popup @@ -440,6 +448,9 @@ class Popup_window: self.lab.set_text(pu_text) self.window.show_all() + + self.window.set_transient_for(stat_window.main_window) + # set_keep_above(1) for windows if os.name == 'nt': self.topify_window(self.window)