def findAppWithLargestId(desktop, find): ''' Find the application with the largest id whose name matches find If ids are not recycled (i.e., ids always increment and never start over again at 1), the application with the highest id will be the last launched. We're making this assumption. ''' appWithLargestId = None apps = utils.findAllDescendants(desktop, lambda x: pyatspi.ROLE_APPLICATION == x.role and find.search(x.name), False) if len(apps) > 0: appWithLargestId = apps[0] for a in apps: if a._accessible.id > appWithLargestId._accessible.id: appWithLargestId = a return appWithLargestId
def findAppWithLargestId(desktop, find): ''' Find the application with the largest id whose name matches find If ids are not recycled (i.e., ids always increment and never start over again at 1), the application with the highest id will be the last launched. We're making this assumption. ''' appWithLargestId = None apps = utils.findAllDescendants( desktop, lambda x: pyatspi.ROLE_APPLICATION == x.role and find. search(x.name), False) if len(apps) > 0: appWithLargestId = apps[0] for a in apps: if a._accessible.id > appWithLargestId._accessible.id: appWithLargestId = a return appWithLargestId
def findMethod(name, checkShowing=True, recursive=True): dontCheckShowing = not checkShowing return utils.findAllDescendants( self, lambda x: x.role == v[ a] and utils.equalsOrMatches(x.name, name) and (dontCheckShowing or x.showing), recursive)
def findMethod(name, checkShowing=True, recursive=True): dontCheckShowing = not checkShowing return utils.findAllDescendants(self, lambda x: x.role == v[a] and utils.equalsOrMatches(x.name, name) and (dontCheckShowing or x.showing), recursive)