communication.functions module
This module contains helper functions.
- communication.functions.handle_sigterm(*_args)[source]
Sigterm handler: raise KeyboardInterrupt.
- Parameters:
*_args (
Any
) – unused arguments, accept any arguments- Raises:
KeyboardInterrupt – raises a keyboard interrupt
- Return type:
None
- communication.functions.init(name, logger_level=20)[source]
Initialize logger and sigterm handler.
- Parameters:
name (
str
) – name of the loggerlogger_level (
int
) – the logging level to use
- Return type:
Logger
- Returns:
a logger instance
- communication.functions.redirect_importerror_to_optionalimporterror()[source]
Redirect ImportError to OptionalImportError.
- Raises:
OptionalImportError – Managed context raised ImportError
- Return type:
Iterator
[None
]- Returns:
Pass control from within a try block