From 3f140ab15717f0c4ff9c3c684287403380bf27d3 Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Sun, 29 Nov 2009 12:25:02 -0500 Subject: [PATCH] exception traceback in idle_func in create_hud --- pyfpdb/HUD_main.py | 18 +++++++++--------- pyfpdb/Hud.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 6f63a2b5..22184b42 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -105,10 +105,7 @@ class HUD_main(object): def idle_func(): gtk.gdk.threads_enter() - try: # TODO: seriously need to decrease the scope of this block.. what are we expecting to error? - # TODO: The purpose of this try/finally block is to make darn sure that threads_leave() - # TODO: gets called. If there is an exception and threads_leave() doesn't get called we - # TODO: lock up. REB + try: table.gdkhandle = gtk.gdk.window_foreign_new(table.number) newlabel = gtk.Label("%s - %s" % (table.site, table_name)) self.vb.add(newlabel) @@ -122,9 +119,12 @@ class HUD_main(object): m.update_gui(new_hand_id) self.hud_dict[table_name].update(new_hand_id, self.config) self.hud_dict[table_name].reposition_windows() + except: + print "*** Exception in HUD_main::idle_func() *** " + traceback.print_stack() finally: gtk.gdk.threads_leave() - return False + return False self.hud_dict[table_name] = Hud.Hud(self, table, max, poker_game, self.config, self.db_connection) self.hud_dict[table_name].table_name = table_name @@ -143,11 +143,11 @@ class HUD_main(object): self.hud_dict[table_name].hud_params['h_agg_bb_mult'] = 1 # sqlcoder: I forget why these are set to true (aren't they ignored from now on?) # but I think it's needed: - self.hud_params['aggregate_ring'] == True - self.hud_params['h_aggregate_ring'] == True + self.hud_params['aggregate_ring'] = True + self.hud_params['h_aggregate_ring'] = True # so maybe the tour ones should be set as well? does this fix the bug I see mentioned? self.hud_params['aggregate_tour'] = True - self.hud_params['h_aggregate_tour'] == True + self.hud_params['h_aggregate_tour'] = True [aw.update_data(new_hand_id, self.db_connection) for aw in self.hud_dict[table_name].aux_windows] gobject.idle_add(idle_func) @@ -168,7 +168,7 @@ class HUD_main(object): pass finally: gtk.gdk.threads_leave() - return False + return False gobject.idle_add(idle_func) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 4b69f1b3..c9fe2f0a 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -409,7 +409,7 @@ class Hud: try: # throws "invalid window handle" in WinXP (sometimes?) s.window.destroy() - except: + except: # TODO: what exception? pass self.stat_windows = {} # also kill any aux windows