diff --git a/pipenv/core.py b/pipenv/core.py index 7daff2be..b1f8c9fe 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -678,7 +678,7 @@ def batch_install(deps_list, procs, failed_deps_queue, from .vendor.requirementslib.models.utils import strip_extras_markers_from_requirement failed = (not retry) if not failed: - label = INSTALL_LABEL if os.name != "nt" else "" + label = INSTALL_LABEL if not PIPENV_HIDE_EMOJIS else "" else: label = INSTALL_LABEL2 diff --git a/pipenv/environments.py b/pipenv/environments.py index f4510621..24ea5631 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -70,13 +70,18 @@ Default is to detect emulators automatically. This should be set if your emulator, e.g. Cmder, cannot be detected correctly. """ -PIPENV_HIDE_EMOJIS = bool(os.environ.get("PIPENV_HIDE_EMOJIS")) +PIPENV_HIDE_EMOJIS = os.environ.get("PIPENV_HIDE_EMOJIS") """Disable emojis in output. Default is to show emojis. This is automatically set on Windows. """ -if os.name == "nt" or PIPENV_IS_CI: +if (PIPENV_HIDE_EMOJIS is None and (os.name == "nt" or PIPENV_IS_CI)) or ( + PIPENV_HIDE_EMOJIS is not None + and PIPENV_HIDE_EMOJIS.lower() not in ('0', 'false', 'no') +): PIPENV_HIDE_EMOJIS = True +else: + PIPENV_HIDE_EMOJIS = False PIPENV_IGNORE_VIRTUALENVS = bool(os.environ.get("PIPENV_IGNORE_VIRTUALENVS")) """If set, Pipenv will always assign a virtual environment for this project. @@ -295,9 +300,7 @@ def is_in_virtualenv(): if not pipenv_active and not ignore_virtualenvs: virtual_env = os.environ.get("VIRTUAL_ENV") use_system = bool(virtual_env) - return (use_system or virtual_env) and not ( - pipenv_active or ignore_virtualenvs - ) + return (use_system or virtual_env) and not (pipenv_active or ignore_virtualenvs) PIPENV_SPINNER_FAIL_TEXT = fix_utf8(u"✘ {0}") if not PIPENV_HIDE_EMOJIS else ("{0}") diff --git a/pipenv/progress.py b/pipenv/progress.py index 1328e4d5..8968150c 100644 --- a/pipenv/progress.py +++ b/pipenv/progress.py @@ -21,25 +21,20 @@ from .environments import PIPENV_COLORBLIND, PIPENV_HIDE_EMOJIS STREAM = sys.stderr MILL_TEMPLATE = "%s %s %i/%i\r" DOTS_CHAR = "." -if os.name != "nt": - if PIPENV_HIDE_EMOJIS: - if PIPENV_COLORBLIND: - BAR_FILLED_CHAR = "=" - BAR_EMPTY_CHAR = "-" - else: - BAR_FILLED_CHAR = str(crayons.green("=", bold=True)) - BAR_EMPTY_CHAR = str(crayons.black("-")) +if PIPENV_HIDE_EMOJIS: + if PIPENV_COLORBLIND: + BAR_FILLED_CHAR = "=" + BAR_EMPTY_CHAR = "-" else: - if PIPENV_COLORBLIND: - BAR_FILLED_CHAR = "▉" - BAR_EMPTY_CHAR = " " - else: - BAR_FILLED_CHAR = str(crayons.green("▉", bold=True)) - BAR_EMPTY_CHAR = str(crayons.black("▉")) - + BAR_FILLED_CHAR = str(crayons.green("=", bold=True)) + BAR_EMPTY_CHAR = str(crayons.black("-")) else: - BAR_FILLED_CHAR = "=" - BAR_EMPTY_CHAR = "-" + if PIPENV_COLORBLIND: + BAR_FILLED_CHAR = "▉" + BAR_EMPTY_CHAR = " " + else: + BAR_FILLED_CHAR = str(crayons.green("▉", bold=True)) + BAR_EMPTY_CHAR = str(crayons.black("▉")) if (sys.version_info[0] >= 3) and (os.name != "nt"): BAR_TEMPLATE = u" %s%s%s %i/%i — {0}\r".format(crayons.black("%s"))