let windows user configure to have emojis

This commit is contained in:
frostming
2019-03-08 14:48:01 +08:00
parent 7dbd5feee1
commit fde365140c
3 changed files with 21 additions and 23 deletions
+1 -1
View File
@@ -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
+8 -5
View File
@@ -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}")
+12 -17
View File
@@ -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"))