# Path: bento/utils/utils.py
# def pprint(color, s, fout=None):
#     if fout is None:
#         fout = sys.stderr
#     fout.write('%s%s%s\n' % (COLORS(color), s, COLORS('NORMAL')))


import os
import shutil
import sys
import tempfile
import ntpath
import posixpath
import os.path as op
from six \
    import \
        BytesIO
from subprocess \
    import \
        PIPE, STDOUT, Popen
from bento.utils.utils \
    import \
        pprint
    log.write(" -> testing straight numpy.distutils\n")
    return _test(numpy_code % {"filename": setup_py, "odir": odir}, setup_py,
                 show_output, log)

def test_setuptools_numpy(setup_py, show_output, log):
    odir = os.path.dirname(os.path.abspath(setup_py))
    log.write("bentomaker: convert\n")
    log.write(" -> testing numpy.distutils monkey-patched by setuptools\n")
    return _test(setuptools_numpy_code % {"filename": setup_py, "odir": odir}, setup_py,
                 show_output, log)

def test_can_run(setup_py, show_output, log):
    odir = os.path.dirname(os.path.abspath(setup_py))
    log.write("bentomaker: convert\n")
    log.write(" -> testing whether setup.py can be executed without errors\n")
    return _test(can_run_code % {"filename": setup_py, "odir": odir}, setup_py,
                 show_output, log)

def whole_test(setup_py, verbose, log):
    if verbose:
        show_output = True
    else:
        show_output = False

    if not test_can_run(setup_py, show_output, log):
        pass
    if verbose:
        pprint("YELLOW", "----------------- Testing distutils ------------------")
    use_distutils = test_distutils(setup_py, show_output, log)
    if verbose:

# Path: bento/utils/utils.py
# def pprint(color, s, fout=None):
#     if fout is None:
#         fout = sys.stderr
#     fout.write('%s%s%s\n' % (COLORS(color), s, COLORS('NORMAL')))


# Path: bento/convert/utils.py
import os
import shutil
import sys
import tempfile
import ntpath
import posixpath
import os.path as op
from six \
    import \
        BytesIO
from subprocess \
    import \
        PIPE, STDOUT, Popen
from bento.utils.utils \
    import \
        pprint

    log.write(" -> testing straight numpy.distutils\n")
    return _test(numpy_code % {"filename": setup_py, "odir": odir}, setup_py,
                 show_output, log)

def test_setuptools_numpy(setup_py, show_output, log):
    odir = os.path.dirname(os.path.abspath(setup_py))
    log.write("bentomaker: convert\n")
    log.write(" -> testing numpy.distutils monkey-patched by setuptools\n")
    return _test(setuptools_numpy_code % {"filename": setup_py, "odir": odir}, setup_py,
                 show_output, log)

def test_can_run(setup_py, show_output, log):
    odir = os.path.dirname(os.path.abspath(setup_py))
    log.write("bentomaker: convert\n")
    log.write(" -> testing whether setup.py can be executed without errors\n")
    return _test(can_run_code % {"filename": setup_py, "odir": odir}, setup_py,
                 show_output, log)

def whole_test(setup_py, verbose, log):
    if verbose:
        show_output = True
    else:
        show_output = False

    if not test_can_run(setup_py, show_output, log):
        pass
    if verbose:
        pprint("YELLOW", "----------------- Testing distutils ------------------")
    use_distutils = test_distutils(setup_py, show_output, log)
    if verbose:

        pprint("YELLOW", "----------------- Testing setuptools -----------------")