navigate.model.device_startup_functions.auto_redial
- navigate.model.device_startup_functions.auto_redial(func, args, n_tries=10, exception=<class 'Exception'>, **kwargs)
Retries connections to a startup device defined by func n_tries times.
- Parameters:
func (function or class) – The function or class (__init__() function) that connects to a device.
args (tuple) – Arguments to function or class
n_tries (int) – The number of tries to redial.
exception (inherits from BaseException) – An exception type to check on each connection attempt.
- Returns:
val – Result of func
- Return type:
object
Examples
>>> auto_redial(DCAM, (0,), exception=Exception)