ConsoleUser

Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com

This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.

All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.

class ATSPIRegion.ATSPIRegion(config, path)

AT-SPI provides paths and numerous ways of identifying widgets. This class provides a Region implementation using that interface.

Parameters:

  • config: a <no title> object

  • path: the path to the file to load or None for an empty Region

find_in_region(hay, rect=(), debug_match=False)

Treating myself as the needle try to find any places in the haystack we match.

Parameters:

  • hay: a Region that should be searched for instances of myself

  • rect: the points defining a rectangle that restricts the regions for which matches will be accepted

Return: a list containg tuples of x, y coordinates that are the upper left corner of the region matching me

find_regions(needle, rect=(), debug_match=False)

Treating myself as the haystack try to find any places that match the needle.

Parameters:

  • needle: an Region that should be found within myself

  • rect: the points defining a rectangle that restricts the region that should be searched

Return: a list containing tuples of x, y coordinates that are the upper left corner of the region matching the needle

get_desktop()

Get a handle to the default AT-SPI desktop we’ll use to find other elements.

get_sub_region(upper_left, lower_right)

Get a region of this region defined by the two corners of a rectangle

Parameters:

  • upper_left: a row, col (tuple-like) of the upper left corner

  • lower_right: a row, col (tuple-like) of the lower right corner

match_at(needle, corner)

Check at a particular location to see if we match the given needle.

Parameters:

  • needle: a Region to look for

  • corner: a tuple containing the upper left corner to start the match (tuple is in X,Y notation, not Row,Col)

Return: True if the needle is matched there, False otherwise