# Path: starterpyth/log.py
# RED = '31'
# GREEN = '32'
# YELLOW = '33'
# BLUE = '34'
# MAGENTA = '35'
# CYAN = '36'
# WHITE = '37'
# def display(text, color=None, bold=False, newline=True):
# def print_tb(error, msg=None):


import os
import shutil
import subprocess
import sys
from six import u
from starterpyth.log import red, green, cyan, magenta
    for prefix in STDIN_PREFIXES:
        for min_version in PY_VERSIONS:
            for plugins in PLUGIN_VERSIONS:
                for trans in ('yes', 'no'):
                    data = prefix + "\n" + min_version + "\n" + trans + "\n0.1\n" + plugins + "\n"
                    print(magenta(data))
                    for run_version in AVAILABLE_PYTHONS:
                        print(cyan('Running StarterPyth with ' + run_version))
                        if os.path.isdir(TEST_DIRECTORY):
                            shutil.rmtree(TEST_DIRECTORY)
                        cmd = "python{0} -c 'from starterpyth.core import main; main()'".format(run_version)
                        popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                                 stdin=subprocess.PIPE)
                        stdout, stderr = popen.communicate(data.encode('utf-8'))
                        if popen.returncode:
                            print(red(cmd))
                            print(stdout.decode('utf-8'))
                            print(stderr.decode('utf-8'))
                            sys.exit(1)
                        for test_version in PY_VERSIONS[min_version]:
                            if test_version not in AVAILABLE_PYTHONS:
                                continue
                            print('Testing generated code with ' + test_version)
                            for dist_cmd in ('bdist', 'build', 'build_ext', 'test'):
                                cmd = "python{0} setup.py {1}".format(test_version, dist_cmd)
                                popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
                                                         stderr=subprocess.PIPE,
                                                         cwd=TEST_DIRECTORY)
                                stdout, stderr = popen.communicate()
                                if popen.returncode:

# Path: starterpyth/log.py
# RED = '31'
# GREEN = '32'
# YELLOW = '33'
# BLUE = '34'
# MAGENTA = '35'
# CYAN = '36'
# WHITE = '37'
# def display(text, color=None, bold=False, newline=True):
# def print_tb(error, msg=None):


# Path: tests.py
import os
import shutil
import subprocess
import sys
from six import u
from starterpyth.log import red, green, cyan, magenta

    for prefix in STDIN_PREFIXES:
        for min_version in PY_VERSIONS:
            for plugins in PLUGIN_VERSIONS:
                for trans in ('yes', 'no'):
                    data = prefix + "\n" + min_version + "\n" + trans + "\n0.1\n" + plugins + "\n"
                    print(magenta(data))
                    for run_version in AVAILABLE_PYTHONS:
                        print(cyan('Running StarterPyth with ' + run_version))
                        if os.path.isdir(TEST_DIRECTORY):
                            shutil.rmtree(TEST_DIRECTORY)
                        cmd = "python{0} -c 'from starterpyth.core import main; main()'".format(run_version)
                        popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                                 stdin=subprocess.PIPE)
                        stdout, stderr = popen.communicate(data.encode('utf-8'))
                        if popen.returncode:
                            print(red(cmd))
                            print(stdout.decode('utf-8'))
                            print(stderr.decode('utf-8'))
                            sys.exit(1)
                        for test_version in PY_VERSIONS[min_version]:
                            if test_version not in AVAILABLE_PYTHONS:
                                continue
                            print('Testing generated code with ' + test_version)
                            for dist_cmd in ('bdist', 'build', 'build_ext', 'test'):
                                cmd = "python{0} setup.py {1}".format(test_version, dist_cmd)
                                popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
                                                         stderr=subprocess.PIPE,
                                                         cwd=TEST_DIRECTORY)
                                stdout, stderr = popen.communicate()
                                if popen.returncode:

                                    print(red(cmd))