Fix problem with missing tables or unfound tables.

This commit is contained in:
Eratosthenes 2011-03-01 12:22:48 -05:00
parent 6cb65d53a5
commit 20243ac6ed
3 changed files with 7 additions and 3 deletions

View File

@ -266,7 +266,7 @@ class HUD_main(object):
cards = self.get_cards(new_hand_id)
table_kwargs = dict(table_name=table_name, tournament=tour_number, table_number=tab_number)
tablewindow = Tables.Table(self.config, site_name, **table_kwargs)
if tablewindow is None:
if tablewindow.number is None:
# If no client window is found on the screen, complain and continue
if type == "tour":
table_name = "%s %s" % (tour_number, tab_number)

View File

@ -34,9 +34,13 @@ import gtk
import gobject
# FreePokerTools modules
import Configuration
from HandHistoryConverter import getTableTitleRe
from HandHistoryConverter import getTableNoRe
c = Configuration.Config()
log = Configuration.get_logger("logging.conf", "hud", log_dir=c.dir_log, log_file='HUD-log.txt')
# Global used for figuring out the current game being played from the title.
# The dict key is a tuple of (limit type, category) for the game.
# The list is the names for those games used by the supported poker sites
@ -142,7 +146,7 @@ class Table_Window(object):
if self.number is not None: break
trys += 1
if trys > 4:
log.error(_("Can't find table %s") % table_name)
log.error("Can't find table %s" % table_name)
return None
geo = self.get_geometry()

View File

@ -128,7 +128,7 @@ class Table(Table_Window):
des_re = 'No such window with id'
listing = os.popen("xwininfo -id %d -stats" % (self.number)).read()
if listing == "": return
mo = re.search(des_re, listing)
if mo is not None:
return None # table has been destroyed