edcon.utils package
Submodules
edcon.utils.boollist module
Helper functions for converting lists of boolean values
- edcon.utils.boollist.bytes_to_boollist(data: bytes, num_bytes: int | None = None)
Converts data in byte representation to a list of bools
- edcon.utils.boollist.boollist_to_bytes(boollist: list)
Converts a list of bools to byte representation
edcon.utils.func_helpers module
Helper functions used to call other functions.
- edcon.utils.func_helpers.func_sequence(func: Callable[[bool], None], arg_list: list = True, delay: float = 0.1)
Performs a toggling sequence on a provided toggle function
- Parameter:
func (Callable): function that is called sequentially with arg from arg_list delay (float): delay to use between calls of func
- edcon.utils.func_helpers.wait_until(condition: Callable[[], bool] | None = None, error_condition: Callable[[], bool] | None = None, timeout: float = 0.0, info_string: Callable[[], str] | None = None, error_string: Callable[[], str] | None = None) bool
Waits until provided condition is satisfied
- Parameter:
condition (Callable): boolean condition function error_condition (Callable): boolean error condition function which terminates waiting timeout (float): Time that should be waited for condition to be satisfied (in seconds) info_string (Callable): optional callback for string to print during wait process error_string (Callable): optional callback for string to print in error case
- Returns:
True if succesful, False otherwise
- Return type:
bool
- edcon.utils.func_helpers.wait_for(duration: float, error_condition: Callable[[], bool] | None = None, info_string: Callable[[], str] | None = None, error_string: Callable[[], str] | None = None) bool
Waits for provided duration
- Parameter:
duration (float): time that should be waited for error_condition (Callable): boolean error condition function which terminates waiting info_string (Callable): optional callback for string to print during wait process error_string (Callable): optional callback for string to print in error case
- Returns:
True if succesful, False otherwise
- Return type:
bool
edcon.utils.logging module
Contains class which contains logging methods.
- class edcon.utils.logging.Logging(logging_level=20, filename=None)
Bases:
objectClass that contains common functions for logging.
- logger = <Logger edcon (WARNING)>
- enable_stream_logging(logging_level)
Enables logging to stream using the provided log level with rich log formatting.
- enable_file_logging(filename, logging_level)
Enables logging to a file using the provided filename and log level.