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 WindowStub.WindowStub(system, config, app=None)

I encapsulate all the information about a window, and how to interact with it.

Parameters:

  • system: a handle to the remote <no title> on which this window “lives”

  • config: a <no title> object

  • app: if present, its a handle to the application controlling this Window

at_bottom()

Return: True iff the window is scrolled to the bottom

at_top()

Return: True iff the window is scrolled to the top

can_scroll()

Return: True iff there is an enabled verticle scrollbar

find_text(msg, font, scroll=True)

Search for the given string within this window expecting the string to be rendered in a given :doc:Font.

Parameters:

  • msg: The string to search for

  • font: a <no title> object in which the string will be rendered

  • scroll: whether or not to scroll the window to search for the message (if possible). Default’s to True, meaning do scroll.

Return A List of X, Y coordinates for the top left corner of areas which contain the text to be matched

get_focus()

Switch the system so that this window has focus.

Return: a boolean indicating whether or not this failed

has_focus()

Tell whether or not this window has focus. Obviously this may not always be 100% reliable, but hopefully it works most of the time.

Return: a boolean whether or not this window has focus

save_state()

Save the current state of this window – assuming it is currently on top. Temporary (hopefully) restriction: the Window must be maximized.

scroll_down(times)

Click the scroll down button some number of times.

Parameters:

  • times: the number of times to click the down arrow

scroll_up(times)

Click the scroll up button some number of times.

Parameters:

  • times: the number of times to click the up arrow