Locator

class pyjt.Locator(**kwargs)

Bases: object

The Locator determines if a component matches specific search criteria.

Parameters:

**kwargs – Search parameters as keyword arguments.

Search criteria:

The locator constructor receives a list of <name>:<value> keyword arguments and stores them.

For each argument, the locator will call the component’s get<Name>() function and compares it’s return value to <value>. Only if the values are equal, the component matches this search criteria.

contains(**kwargs)

Ensure the control has a sub-component with the given attributes somewhere in the tree.

Parameters:

**kwargs – The search criteria for the sub-component that has to be a part of the component candiate.

Returns:

A reference to this locator object (self)

has(**kwargs)

Ensure the control has a direct sub-component with the given attributes.

matches(component)

The matches function determines wether the given component matches matches the search criteria.

You can implement your own matcher by deriving a class from this Locator and implement this function.

Parameters:

component – The component that should match this search criteria.

Returns:

True, if the component matches this search criteria, otherwise False.

update(**kwargs)

Add more search criteria’s to this locator.

Parameters:

**kwargs – The search criteria’s to add. Any existing search criteria will be overwritten.

Returns:

A reference to this locator object (self)