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