exception traceback in idle_func in create_hud

This commit is contained in:
Eric Blade 2009-11-29 12:25:02 -05:00
parent 41c963baa9
commit 3f140ab157
2 changed files with 10 additions and 10 deletions

View File

@ -105,10 +105,7 @@ class HUD_main(object):
def idle_func(): def idle_func():
gtk.gdk.threads_enter() gtk.gdk.threads_enter()
try: # TODO: seriously need to decrease the scope of this block.. what are we expecting to error? try:
# 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
table.gdkhandle = gtk.gdk.window_foreign_new(table.number) table.gdkhandle = gtk.gdk.window_foreign_new(table.number)
newlabel = gtk.Label("%s - %s" % (table.site, table_name)) newlabel = gtk.Label("%s - %s" % (table.site, table_name))
self.vb.add(newlabel) self.vb.add(newlabel)
@ -122,6 +119,9 @@ class HUD_main(object):
m.update_gui(new_hand_id) m.update_gui(new_hand_id)
self.hud_dict[table_name].update(new_hand_id, self.config) self.hud_dict[table_name].update(new_hand_id, self.config)
self.hud_dict[table_name].reposition_windows() self.hud_dict[table_name].reposition_windows()
except:
print "*** Exception in HUD_main::idle_func() *** "
traceback.print_stack()
finally: finally:
gtk.gdk.threads_leave() gtk.gdk.threads_leave()
return False return False
@ -143,11 +143,11 @@ class HUD_main(object):
self.hud_dict[table_name].hud_params['h_agg_bb_mult'] = 1 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?) # sqlcoder: I forget why these are set to true (aren't they ignored from now on?)
# but I think it's needed: # but I think it's needed:
self.hud_params['aggregate_ring'] == True self.hud_params['aggregate_ring'] = True
self.hud_params['h_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? # 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['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] [aw.update_data(new_hand_id, self.db_connection) for aw in self.hud_dict[table_name].aux_windows]
gobject.idle_add(idle_func) gobject.idle_add(idle_func)

View File

@ -409,7 +409,7 @@ class Hud:
try: try:
# throws "invalid window handle" in WinXP (sometimes?) # throws "invalid window handle" in WinXP (sometimes?)
s.window.destroy() s.window.destroy()
except: except: # TODO: what exception?
pass pass
self.stat_windows = {} self.stat_windows = {}
# also kill any aux windows # also kill any aux windows