guibot.config module

class guibot.config.GlobalConfig[source]

Bases: object

Handler for default configuration present in all cases where no specific value is set.

The methods of this class are shared among all of its instances.

toggle_delay = None

time interval between mouse down and up in a click

click_delay = None

time interval after a click (in a double or n-click)

delay_after_drag = None

timeout before drag operation

delay_before_drop = None

timeout before drop operation

delay_before_keys = None

timeout before key press operation

delay_between_keys = None

time interval between two consecutively typed keys

rescan_speed_on_find = None

time interval between two image matching attempts (used to reduce overhead on the CPU)

smooth_mouse_drag = None

whether to move the mouse cursor to a location instantly or smoothly

screen_autoconnect = None

whether to perform complete initialization of the desktop control backend

preprocess_special_chars = None

whether to preprocess capital and special characters and handle them internally

save_needle_on_error = None

whether to perform an extra needle dump on matching error

image_logging_level = None

logging level similar to the python logging module

image_logging_step_width = None

number of digits when enumerating the image logging steps, e.g. value=3 for 001, 002, etc.

image_logging_destination = None

relative path of the image logging steps

desktop_control_backend = None

name of the desktop control backend

find_backend = None

name of the computer vision backend

contour_threshold_backend = None

name of the contour threshold backend

template_match_backend = None

name of the template matching backend

feature_detect_backend = None

name of the feature detection backend

feature_extract_backend = None

name of the feature extraction backend

feature_match_backend = None

name of the feature matching backend

text_detect_backend = None

name of the text detection backend

text_ocr_backend = None

name of the optical character recognition backend

hybrid_match_backend = None

name of the hybrid matching backend for unconfigured one-step targets

class guibot.config.LocalConfig(configure=True, synchronize=True)[source]

Bases: object

Container for the configuration of all desktop control and computer vision backends, responsible for making them behave according to the selected parameters as well as for providing information about them and the current parameters.

__init__(configure=True, synchronize=True)[source]

Build a container for the entire backend configuration.

Parameters:
  • configure (bool) – whether to also generate configuration
  • synchronize (bool) – whether to also apply configuration

Available algorithms can be seen in the algorithms attribute whose keys are the algorithm types and values are the members of these types. The algorithm types are shortened as categories.

A parameter can be accessed as follows (example):

print(self.params["control"]["vnc_hostname"])
configure_backend(backend=None, category='type', reset=False)[source]

Generate configuration dictionary for a given backend.

Parameters:
  • backend (str or None) – name of a preselected backend, see algorithms[category]
  • category (str) – category for the backend, see algorithms.keys()
  • reset (bool) – whether to (re)set all parent configurations as well
Raises:

UnsupportedBackendError if backend is not among the supported backends for the category (and is not None) or the category is not found

configure(reset=True)[source]

Generate configuration dictionary for all backends.

Parameters:reset (bool) – whether to (re)set all parent configurations as well

If multiple categories are available and just some of them are configured, the rest will be reset to defaults. To configure specific category without changing others, use configure().

synchronize_backend(backend=None, category='type', reset=False)[source]

Synchronize a category backend with the equalizer configuration.

Parameters:
  • backend (str or None) – name of a preselected backend, see algorithms[category]
  • category (str) – category for the backend, see algorithms.keys()
  • reset (bool) – whether to (re)sync all parent backends as well
Raises:

UnsupportedBackendError if the category is not found

Raises:

UninitializedBackendError if there is no backend object that is configured with and with the required name

synchronize(reset=True)[source]

Synchronize all backends with the current configuration dictionary.

Parameters:reset (bool) – whether to (re)sync all parent backends as well