run_iocsh.ioc

Class, exceptions, and utility functions for running an IOC and capturing output.

Attributes

Exceptions

RunIocshError

Base class for exceptions in this module.

IocshModuleNotFoundError

Exception raised when the required module is not found.

IocshProcessError

Exception raised when the iocsh script exits with a non null return code.

IocshTimeoutExpiredError

Exception raised when a timeout occurred trying to send exit to the softIOC.

IocshAlreadyRunningError

Exception raised when IOC is started a second time.

MissingSharedLibraryError

Exception raised when shared library is missing.

Classes

IOC

Class to wrap IOC process.

Functions

run_iocsh(→ None)

Run an IOC, exit, and parse the output.

Module Contents

run_iocsh.ioc.RE_MODULE_NOT_AVAILABLE[source]
run_iocsh.ioc.RE_CANT_OPEN[source]
run_iocsh.ioc.RE_DOES_NOT_EXIST[source]
run_iocsh.ioc.RE_MISSING_SHARED_LIB[source]
exception run_iocsh.ioc.RunIocshError[source]

Bases: Exception

Base class for exceptions in this module.

exception run_iocsh.ioc.IocshModuleNotFoundError[source]

Bases: RunIocshError

Exception raised when the required module is not found.

exception run_iocsh.ioc.IocshProcessError[source]

Bases: RunIocshError

Exception raised when the iocsh script exits with a non null return code.

Only raised if no error was catched (and another exception raised).

exception run_iocsh.ioc.IocshTimeoutExpiredError[source]

Bases: RunIocshError

Exception raised when a timeout occurred trying to send exit to the softIOC.

exception run_iocsh.ioc.IocshAlreadyRunningError[source]

Bases: RunIocshError

Exception raised when IOC is started a second time.

exception run_iocsh.ioc.MissingSharedLibraryError[source]

Bases: RunIocshError

Exception raised when shared library is missing.

class run_iocsh.ioc.IOC(*args: str, timeout: float = 5.0)[source]

Class to wrap IOC process.

executable = 'iocsh'[source]
state_values[source]
proc = None[source]
outs = ''[source]
errs = ''[source]
args = ()[source]
timeout = 5.0[source]
state[source]
__enter__() None[source]
__exit__(exc_type: object, exc_value: object, exc_traceback: object) None[source]
is_running() bool[source]

Check if the ioc is already running.

start() None[source]

Run <self.executable> iocsh script with given command-line args.

exit() None[source]

Send the exit command to the running IOC.

check_output() None[source]

Log and check output from subprocess.

run_iocsh.ioc.run_iocsh(delay: int, *args: str, timeout: float = 5) None[source]

Run an IOC, exit, and parse the output.