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 SystemImpl.SystemImpl(config)¶
I am the abstract interface to the remote system being controlled. My concrete subclasses know how to actually control a target system, possibly through different methods.
I use the Bridge Pattern with the <no title> class to allow the type of connection to the remote system to be changed without changing any other code.
Parameters:
config: a :doc:UserConfig object
- click_mouse(button)¶
Click the given mouse button once.
Parameters:
button: which mouse button should be clicked
- click_region(region)¶
Locate the given region, then click a spot within it (the spot can be any spot in the region, so this may not be suitable for every caller!).
Parameters:
region: a Region to locate on the screen then click
Return: True if the region was found and clicked, False otherwise
- classmethod get_logger_id(config)¶
Get the ID of this instance that should be used as a unique ID for the given connection information.
- get_screen()¶
Get the screen of the remote system as an Region object. The screen is, of course, the largest possible region that could be matched.
Return: a Region object which represents the entire screen
- key_down(key)¶
Hold down a given key. It will be released later by a call to key_up (or some type_str which will also release it).
Parameters:
key: the key to hold. This can be any printable character or a special string which indicates one of the meta keys (e.g. SHIFT). Except when the string is a meta key string this should be exactly 1 character long
- key_up(key)¶
Release a given key. It will probably have been held down by a previous call to key_down.
Parameters:
key: the key to release. This can be any printable character or a special string which indicates one of the meta keys (e.g. SHIFT). Except when the string is a meta key string this should be exactly 1 character long
- mouse_down(button)¶
Press one button on the mouse and do not release it until a later call.
Parameters:
button: which button to press
- mouse_up(button)¶
Release a mouse button which had been pressed (as from a call to mouse_down) earlier.
Parameters:
button: which button to release
- move_mouse(x, y)¶
Move the mouse cursor to the given x, y location. Depending on the Mouse Strategy being used the end coordinates may or may not exactly match the given ones.
Parameters:
x: the x coordinate the mouse should end in
y: the y coordinate the mouse shoudl end in
- SystemImpl.get_system(config)¶
I am a Factory_ method which creates instances of concrete subclasses of <no title> which know the actual details of how to talk to a remote system.
Parameters:
config: a <no title> object that will tell us which host we’re controlling and by what method
Return: an instance of a subclass of <no title> .. _Factory: http://en.wikipedia.org/wiki/Factory_pattern