Walker :: AccessibleWalker :: AccessibleWalker :: Class AccessibleWalker
[hide private]
[frames] | no frames]

Class AccessibleWalker

source code

 object --+    
          |    
Base.Walker --+
              |
             AccessibleWalker

Walks the accessible hierarchy exactly as it is presented. The walk order is an in-order traversal of the subtree of the accessible hierarchy rooted at a top-level window accessible. The subtree is assumed to have no loops, though logic could be added to detect them.

Instance Methods [hide private]
2-tuple of POR, callable
_getFirstChild(self, por)
Gets the first child of the current accessible in the given POR.
source code
2-tuple of POR, callable
_getNextPeer(self, por)
Gets the next peer of the current accessible in the given POR.
source code
2-tuple of POR, callable
_getParentNextPeer(self, por)
Gets the parent accessible of the current accessible in the given POR.
source code
2-tuple of POR, callable
_getPrevPeer(self, por)
Gets the previous peer of the current accessible in the given POR.
source code
2-tuple of POR, callable
_getLastChild(self, por)
Gets the last child of the accessible in the given POR.
source code
2-tuple of POR, callable
_getParent(self, por)
Gets the parent accessible of the one in the given POR.
source code
POR
_getLastAcc(self, por)
Gets the last accessible of the given POR.
source code
POR or None
getNextPOR(self)
Gets the next POR in the walk order.
source code
POR or None
getPrevPOR(self)
Gets the previous POR in the walk order.
source code
POR
getParentPOR(self)
Returns: Point of regard to the parent of the current accessible or None if it does not exist
source code
POR
getFirstPOR(self)
Returns: Point of regard to the first accessible
source code
POR
getLastPOR(self)
Returns: Point of regard to the last accessible
source code

Inherited from Base.Walker: __init__, getCurrPOR

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]

Inherited from Base.Walker: por

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_getFirstChild(self, por)

source code 

Gets the first child of the current accessible in the given POR. Returns the child accessible if it exists. If it does not exist, returns the given POR and _getNextPeer as the method to call to continue the search.

Parameters:
Returns: 2-tuple of POR, callable
POR and the next method to call to continue the search, or POR and None to indicate the search is complete

_getNextPeer(self, por)

source code 

Gets the next peer of the current accessible in the given POR. Returns the peer accessible if it exists, is visible, and is not trivial. If it does not exist, returns the given POR and _getParentNextPeer as the method to call to continue the search. If it is invisible, returns the peer POR and _getNextPeer as the method to call to continue the search. If it is trivial, returns the peer and _getFirstChild as the method to call to continue the search. If it is trivial, returns the child accessible and _getFirstChild as the method to call to continue the search.

Parameters:
Returns: 2-tuple of POR, callable
POR and the next method to call to continue the search, or POR and None to indicate the search is complete

_getParentNextPeer(self, por)

source code 

Gets the parent accessible of the current accessible in the given POR. Returns the parent and _getNextPeer as the method to call to continue the search if the parent exists. Returns a sentinel (None, None) if there is no parent indicating the given POR is the root of the subtree containing the starting POR.

Parameters:
Returns: 2-tuple of POR, callable
POR and the next method to call to continue the search, or POR and None to indicate the search is complete

_getPrevPeer(self, por)

source code 

Gets the previous peer of the current accessible in the given POR. If it does not exist, returns the given POR and _getParent as the method to call to continue the search. If it is not visible, returns the peer accessible and _getPrevPeer as the method to call to continue the search. Otherwise, returns the peer accessible and _getLastChild as the method to call to continue the search.

Parameters:
Returns: 2-tuple of POR, callable
POR and the next method to call to continue the search, or POR and None to indicate the search is complete

_getLastChild(self, por)

source code 

Gets the last child of the accessible in the given POR. If it does not exist, checks if the given POR is invisible or trivial. If so, returns the given POR and _getPrevPeer to continue the search. If not, returns a POR to the last item in the given POR as the result.

If the last child does exist, checks if it is visible. If so, returns the child and _getLastChild to continue the search. If not, returns the child and _getPrevPeer to continue the search.

Parameters:
Returns: 2-tuple of POR, callable
POR and the next method to call to continue the search, or POR and None to indicate the search is complete

_getParent(self, por)

source code 

Gets the parent accessible of the one in the given POR. Returns the last item in the parent if it exists. If it does not exist, Returns a sentinel (None, None) indicating the given POR is the root of the subtree containing the starting POR. If the parent is invisible or trivial, returns the parent and _getPrevPeer as the method to call to continue the search.

Parameters:
Returns: 2-tuple of POR, callable
POR and the next method to call to continue the search, or POR and None to indicate the search is complete, or None and None to indicate we're at the root

_getLastAcc(self, por)

source code 

Gets the last accessible of the given POR. Returns the given POR if any errors occur.

Parameters:
Returns: POR
POR pointing to the last accessible in the given POR

getNextPOR(self)

source code 

Gets the next POR in the walk order. Calls _getFirstChild, _getNextPeer, and _getParentNextPeer to attempt to get the next valid POR. Each method determines whether the POR is valid as the next POR, and, if not, which call to make next. Each method potentially returns a POR and the next method to call to continue the search for the next POR.

Returns: POR or None
Next POR or None if this is the last POR
Overrides: Base.Walker.getNextPOR

getPrevPOR(self)

source code 

Gets the previous POR in the walk order. Calls _getPrevPeer, _getLastChild, and _getParent to attempt to get the previous valid POR. Each method determines whether the POR is valid as the previous POR, and, if not, which call to make next. Each method potentially returns a POR and the next method to call to continue the search for the previous POR.

Returns: POR or None
Previous POR or None if this is the first POR
Overrides: Base.Walker.getPrevPOR

getParentPOR(self)

source code 
Returns: POR
Point of regard to the parent of the current accessible or None if it does not exist
Overrides: Base.Walker.getParentPOR

getFirstPOR(self)

source code 
Returns: POR
Point of regard to the first accessible
Overrides: Base.Walker.getFirstPOR

getLastPOR(self)

source code 
Returns: POR
Point of regard to the last accessible
Overrides: Base.Walker.getLastPOR