From b9f77e1bdb513f0c4d4d4547f6891a3ade19eb89 Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Wed, 10 Nov 2010 23:26:55 -0500 Subject: [PATCH] Fix table match for Winamax. --- pyfpdb/XTables.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyfpdb/XTables.py b/pyfpdb/XTables.py index fd9189c6..b9a363d0 100644 --- a/pyfpdb/XTables.py +++ b/pyfpdb/XTables.py @@ -44,13 +44,19 @@ class Table(Table_Window): def find_table_parameters(self): + reg = ''' + \s+(?P[\dxabcdef]+) # XID in hex + \s(?P.+): # window title + ''' + self.number = None for listing in os.popen('xwininfo -root -tree').readlines(): 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) - title = re.sub('\"', '', mo.group(2)) + mo = re.match(reg, listing, re.VERBOSE) +# 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 - self.number = int( mo.group(1), 0) + self.number = int( mo.groupdict()["XID"], 0 ) self.title = title self.hud = None # specified later break