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 User.User(path)

This is the class through which all access to a remote system should be brokered. This will provide a number of high level functions which can be used to accomplish tasks (like browse to URI) without needing to use the low level functions provided to type or move/click the mouse.

Parameters:

  • path: a string that is the path to the config file to load

can_login()

This can be called to see if the user would be able to login now if asked. It will try to determine this without disturbing the system if possible, but it may be necessary to move the mouse or other types of actions to determine the current state.

Return: a value less than 0 on error, 0 if the user could

login, 1 if there is already a user logged in, 2 if the screen is locked, or 3 if there is a dialog indicating the system is busy

find_current_app()

Enumerate the apps this User has loaded and see if any of them report that the currently focused app is one belonging to them. If so, return that app, None otherwise.

getApps()

Get a list of all applications that are available for this user. Each of these is an instance of an application class (e.g., <no title>) that is tied to this user.

Return: a list of application objects loaded for this user

get_apps()

Get a list of all applications that are available for this user. Each of these is an instance of an application class (e.g., <no title>) that is tied to this user.

Return: a list of application objects loaded for this user

get_logger()

Return: the <no title> object for this User

is_logged_in()

Check to see if anyone (whether the intended user or not) is logged in on the target system or not.

Return: True if there is a user logged in, False if there

is not and None if there is no login manager for this User

login()

Attempt to login to the remote system.

Return: True if the login succeeds, False if it fails and

None if there is no login manager for this User

logout()

Attempt to logout from the remote system.

Return: True if the logout succeeds, False if it fails and

None if there is no login manager for this User

passive_is_logged_in()

In a way which does not disturb the system (e.g., moving the mouse) try to verify whether or not there is a user logged in.

Because we cannot disturb the system there is a higher chance of false negative than when calling isLoggedIn().

Return: True if evidence of a user being logged was found,

False if the particular attempted verification failed or None if there not a <no title> object to do the verification

restart()

Attempt to restart the remote system.

Return: True if the restart seems to start successfully