Other Functions

Function Synopsis

FunctionBrief Description
cleanup() Release all resources allocated by xaut.
init_defaults() Initialize (or reinitialize) default values.
verbose([tf]) Cause xaut to print messages to the console.
extra_verbose([tf]) Cause xaut to print lots of messages to the console.

Function:

cleanup()

Releases the resources used by xaut. Note that it is not normally required to call this function, but it may help in the event that resources are limited and xaut is no longer needed. The resources are always released when the python prompt which imported xaut exits.

Parameters:

(none)

Return Value:

(none)

Example(s):

#We're going to allocate resources inside a function on purpose
def test():
    import xaut
    kbd = xaut.keyboard()
    kbd.type("foo bar")
    xaut.cleanup()

test()
#xaut is no longer using memory

Function:

init_defaults()

Initializes (or reinitializes) xaut default values. It is not normally necessary to call this function before use of xaut, since it is called internally before any action which requires valid defaults. Probably the best reason to use this would be to reset all remembered values back to defaults after making changes. E.g. if you have set the mouse move delay, you can reset it to default by calling this.

Parameters:

(none)

Return Value:

(none)

Example(s):

#Set a few values to weird things, then clean up
import xaut
xaut.verbose()
xaut.extra_verbose()
mouse = xaut.mouse()
mouse.move_delay(100)
mouse.down_delay(100)
mouse.click_delay(100)
xaut.init_defaults()
        

Function:

verbose([tf])

When true, xaut prints information to the console about what it is doing.

Parameters:

ParamReqDescription
tf no Non zero means true, everything else means false. Assumes true if no value is supplied.

Return Value:

(none)

Example(s):

#Show information about the window search
import xaut
xaut.verbose() #Note the lack of flag
win = xaut.window.find_window("foo")
xaut.verbose(0) #Turns off verbose
win = xaut.window.find_window("foo")
xaut.verbose(1) #Using a flag this time
win = xaut.window.find_window("foo")

Function:

extra_verbose()

When true, xaut prints lots of information about what it is doing.

Parameters:

ParamReqDescription
tf no Non zero means true, everything else means false. Assumes true if no value is supplied.

Return Value:

(none)

Example(s):

#Show LOTS of information about the window search
import xaut
xaut.extra_verbose() #Note the lack of flag
win = xaut.window.find_window("foo")
xaut.extra_verbose(0) #Turns off extra_verbose
win = xaut.window.find_window("foo")
xaut.extra_verbose(1) #Using a flag this time
win = xaut.window.find_window("foo")