search string for table detect changed

This commit is contained in:
Gerko de Roo 2009-12-23 21:12:56 +01:00 committed by Worros
parent 624ab07f85
commit f66b8307d3
2 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ or None if we fail to get the info """
def getTableTitleRe(type, table_name=None, tournament = None, table_number=None): def getTableTitleRe(type, table_name=None, tournament = None, table_number=None):
"Returns string to search in windows titles" "Returns string to search in windows titles"
if type=="tour": if type=="tour":
return "%s.+Table\s%s" % (tournament, table_number) return "%s.+Table.+%s" % (tournament, table_number)
else: else:
return table_name return table_name

View File

@ -161,7 +161,7 @@ def discover_posix_by_name(c, tablename):
def discover_posix_tournament(c, t_number, s_number): def discover_posix_tournament(c, t_number, s_number):
"""Finds the X window for a client, given tournament and table nos.""" """Finds the X window for a client, given tournament and table nos."""
search_string = "%s.+Table\s%s" % (t_number, s_number) search_string = "%s.+Table.+%s" % (t_number, s_number)
for listing in os.popen('xwininfo -root -tree').readlines(): for listing in os.popen('xwininfo -root -tree').readlines():
if re.search(search_string, listing): if re.search(search_string, listing):
return decode_xwininfo(c, listing) return decode_xwininfo(c, listing)