settings

This object gives access to the configuration variables inside Expect.

settings.name = new_value

Set the expect variable specified by name to the new value.

value = settings.name

Return the current setting.

list_of_names = dir(settings)

Return the list of variable names that can be passed to set.

settings.reset()
settings.reset(name)

Reset the settings to factory defaults. "Factory defaults" are the values when the module is first loaded.

dict_of_values = settings.toDict()

Return a dictionary dumping the current settings. The dictionary is not tied to the settings object; changes made to the dictionary are not reflected in the settings object.


VariableExpectPython type Modifiable?
loguserexp_loguserbooleanyes
internalexp_internalbooleanyes
timeouttimeoutintegeryes
full_buffer(none)booleanyes
disconnected(none)booleanno
remove_nullsremove_nullsbooleanyes
tty_copyspawn -nottycopyboolean yes
tty_initspawn -nottyinitboolean yes
stty_initstty_initstringyes

Old interface: set

The old interface still exists for backward compatibility.

old_value = set(name, new_value)

Set the expect variable specified by name to the new value, return the previous value.

current_value = set(name)

Return the current setting of the given expect variable.

list_of_names = set()

The list of variables are the same as for settings above.