예제 #1
0
파일: cache.py 프로젝트: GNOME/strongwind
    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
예제 #2
0
    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
예제 #3
0
 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)
예제 #4
0
 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)