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 DummyWindow.DummyWindow(system, config, app=None)¶
This is a sort of “null” window. It responds positively to the API calls, but does not attempt to tie things to remote system.
- 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_regions_within(region)¶
Look within this Window’s viewable area for a match to the given region.
Parameters:
region: a Region to find or a list of regions
Return: the coordinates of all matches visible at the time
- 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
- find_window_edges()¶
Find the 4 corners of this window, and save them for future use.
Preconditions:
the window of interest is “on top”
the window of interest has focus
the window of interest is fully visible (not off any edges)
Postconditions:
system state is unchanged, save possibly having the mouse moved
self.<corner> variables are populated if possible
Return True if the corners were found, False otherwise
- 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
- move_mouse_out()¶
Move the mouse outside the current window
- save_state()¶
Save the current state of this window
- scroll_down(times)¶
Click the scroll down button some number of times.
Parameters:
times: the number of times to click the down arrow
- scroll_to_bottom()¶
Scroll the current window to the bottom.
- scroll_to_top()¶
Scroll the current window to the top.
- scroll_up(times)¶
Click the scroll up button some number of times.
Parameters:
times: the number of times to click the up arrow