Wexpect util

Wexpect is a Windows variant of pexpect https://pexpect.readthedocs.io.

Wexpect is a Python module for spawning child applications and controlling them automatically.

wexpect util contains small functions, and classes, which are used in multiple classes. The command line argument parsers, and the Exceptions placed here.

Functions

wexpect_util.str2bool()
wexpect_util.spam(message, *args, **kws)

Very verbose debug dunction.

wexpect_util.init_logger()

Initializes the logger. I wont measure coverage for this debug method.

wexpect_util.split_command_line(escape_char='^')

This splits a command line into a list of arguments. It splits arguments on spaces, but handles embedded quotes, doublequotes, and escaped characters. It’s impossible to do this with a regular expression, so I wrote a little state machine to parse the command line.

wexpect_util.join_args()

Joins arguments a command line. It quotes all arguments that contain spaces or any of the characters ^!$%&()[]{}=;’+,`~

ExceptionPexpect

class wexpect.wexpect_util.ExceptionPexpect(value)

Base class for all exceptions raised by this module.

EOF

class wexpect.wexpect_util.EOF(value)

Raised when EOF is read from a child. This usually means the child has exited. The user can wait to EOF, which means he waits the end of the execution of the child process.

TIMEOUT

class wexpect.wexpect_util.TIMEOUT(value)

Raised when a read time exceeds the timeout.