Fix table match for Winamax.

This commit is contained in:
Eratosthenes 2010-11-10 23:26:55 -05:00
parent 2dcc39cdfc
commit b9f77e1bdb

View File

@ -44,13 +44,19 @@ class Table(Table_Window):
def find_table_parameters(self): def find_table_parameters(self):
reg = '''
\s+(?P<XID>[\dxabcdef]+) # XID in hex
\s(?P<TITLE>.+): # window title
'''
self.number = None self.number = None
for listing in os.popen('xwininfo -root -tree').readlines(): for listing in os.popen('xwininfo -root -tree').readlines():
if re.search(self.search_string, listing, re.I): if re.search(self.search_string, listing, re.I):
mo = re.match('\s+([\dxabcdef]+) (.+):\s\(\"([a-zA-Z0-9\-.]+)\".+ (\d+)x(\d+)\+\d+\+\d+ \+(\d+)\+(\d+)', listing) mo = re.match(reg, listing, re.VERBOSE)
title = re.sub('\"', '', mo.group(2)) # mo = re.match('\s+([\dxabcdef]+) (.+):\s\(\"([a-zA-Z0-9\-.]+)\".+ (\d+)x(\d+)\+\d+\+\d+ \+(\d+)\+(\d+)', listing)
title = re.sub('\"', '', mo.groupdict()["TITLE"])
if self.check_bad_words(title): continue if self.check_bad_words(title): continue
self.number = int( mo.group(1), 0) self.number = int( mo.groupdict()["XID"], 0 )
self.title = title self.title = title
self.hud = None # specified later self.hud = None # specified later
break break