def InterfaceComm(name, comm_class=None, **kwargs):
    r"""Short hand for initializing a default comm for use as an interface.

    Args:
        name (str): The name of the message queue.
        comm_class (CommBase, optional): Communication class that should be
            used. Defaults to DefaultComm if not provided.
        **kwargs: Additional keyword arguments are passed to DefaultComm.

    """
    if comm_class is None:
        comm_class = DefaultComm
    kwargs.update(is_interface=True)
    if 'language' not in kwargs:
        kwargs['language'] = tools.get_subprocess_language()
    return comm_class(name, **kwargs)
Example #2
0
def YggAsciiArrayOutput(name, fmt, **kwargs):
    r"""Get class for handling table-like formatted output as arrays.

    Args:
        name (str): The name of the message queue where output should be sent.
        fmt (str): A C style format string specifying how each 'row' of output
            should be formated. This should include the newline character.
        **kwargs: Additional keyword arguments are passed to YggAsciiTableOutput.

    Returns:
        DefaultComm: Communication object.
        
    """
    if 'language' not in kwargs:
        kwargs['language'] = tools.get_subprocess_language()
    kwargs.update(as_array=True, send_converter='table')
    return YggAsciiTableOutput(name, fmt, **kwargs)