docs/support/term_echo.py
def ste(command, nindent, mdir, fpointer):
    r"""
    Echo terminal output.

    Print STDOUT resulting from a given Bash shell command (relative to the
    package :code:`pypkg` directory) formatted in reStructuredText

    :param command: Bash shell command, relative to
                    :bash:`${PMISC_DIR}/pypkg`
    :type  command: string

    :param nindent: Indentation level
    :type  nindent: integer

    :param mdir: Module directory
    :type  mdir: string

    :param fpointer: Output function pointer. Normally is :code:`cog.out` but
                     :code:`print` or other functions can be used for
                     debugging
    :type  fpointer: function object

    For example::

        .. This is a reStructuredText file snippet
        .. [[[cog
        .. import os, sys
        .. from docs.support.term_echo import term_echo
        .. file_name = sys.modules['docs.support.term_echo'].__file__
        .. mdir = os.path.realpath(
        ..     os.path.dirname(
        ..         os.path.dirname(os.path.dirname(file_name))
        ..     )
        .. )
        .. [[[cog ste('build_docs.py -h', 0, mdir, cog.out) ]]]

        .. code-block:: bash

        $ ${PMISC_DIR}/pypkg/build_docs.py -h
        usage: build_docs.py [-h] [-d DIRECTORY] [-n NUM_CPUS]
        ...

        .. ]]]

    """
    term_echo(
        "${{PMISC_DIR}}{sep}pypkg{sep}{cmd}".format(sep=os.path.sep, cmd=command),
        nindent,
        {"PMISC_DIR": mdir},
        fpointer,
    )
def ste(command, nindent, mdir, fpointer):
    r"""
    Echo terminal output.

    Print STDOUT resulting from a given Bash shell command (relative to the
    package :code:`pypkg` directory) formatted in reStructuredText

    :param command: Bash shell command, relative to
                    :bash:`${PMISC_DIR}/pypkg`
    :type  command: string

    :param nindent: Indentation level
    :type  nindent: integer

    :param mdir: Module directory
    :type  mdir: string

    :param fpointer: Output function pointer. Normally is :code:`cog.out` but
                     :code:`print` or other functions can be used for
                     debugging
    :type  fpointer: function object

    For example::

        .. This is a reStructuredText file snippet
        .. [[[cog
        .. import os, sys
        .. from docs.support.term_echo import term_echo
        .. file_name = sys.modules['docs.support.term_echo'].__file__
        .. mdir = os.path.realpath(
        ..     os.path.dirname(
        ..         os.path.dirname(os.path.dirname(file_name))
        ..     )
        .. )
        .. [[[cog ste('build_docs.py -h', 0, mdir, cog.out) ]]]

        .. code-block:: bash

        $ ${PMISC_DIR}/pypkg/build_docs.py -h
        usage: build_docs.py [-h] [-d DIRECTORY] [-n NUM_CPUS]
        ...

        .. ]]]

    """
    term_echo(
        "${{PMISC_DIR}}{sep}pypkg{sep}{cmd}".format(sep=os.path.sep, cmd=command),
        nindent,
        {"PMISC_DIR": mdir},
        fpointer,
    )
def ste ( command , nindent , mdir , fpointer ) : term_echo ( "${{PMISC_DIR}}{sep}pypkg{sep}{cmd}" . format ( sep = os . path . sep , cmd = command ) , nindent , { "PMISC_DIR" : mdir } , fpointer , )
r"""
    Echo terminal output.

    Print STDOUT resulting from a given Bash shell command (relative to the
    package :code:`pypkg` directory) formatted in reStructuredText

    :param command: Bash shell command, relative to
                    :bash:`${PMISC_DIR}/pypkg`
    :type  command: string

    :param nindent: Indentation level
    :type  nindent: integer

    :param mdir: Module directory
    :type  mdir: string

    :param fpointer: Output function pointer. Normally is :code:`cog.out` but
                     :code:`print` or other functions can be used for
                     debugging
    :type  fpointer: function object

    For example::

        .. This is a reStructuredText file snippet
        .. [[[cog
        .. import os, sys
        .. from docs.support.term_echo import term_echo
        .. file_name = sys.modules['docs.support.term_echo'].__file__
        .. mdir = os.path.realpath(
        ..     os.path.dirname(
        ..         os.path.dirname(os.path.dirname(file_name))
        ..     )
        .. )
        .. [[[cog ste('build_docs.py -h', 0, mdir, cog.out) ]]]

        .. code-block:: bash

        $ ${PMISC_DIR}/pypkg/build_docs.py -h
        usage: build_docs.py [-h] [-d DIRECTORY] [-n NUM_CPUS]
        ...

        .. ]]]
r Echo terminal output .