From c264f7ef1234d8e298102eb29ce2f7c145cfb7b4 Mon Sep 17 00:00:00 2001 From: derAnfaenger Date: Thu, 23 Nov 2017 17:46:03 +0100 Subject: [PATCH] provisioning: Enhance warning for Python 2.7. Color-highlight the warning. Use print instead of warnings.warn (this omits unnecessary debug info). --- tools/provision | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/provision b/tools/provision index 4919767..dc0df22 100755 --- a/tools/provision +++ b/tools/provision @@ -4,7 +4,6 @@ import os import sys import argparse import subprocess -import warnings from importlib import import_module @@ -14,6 +13,11 @@ sys.path.append(ZULIP_BOTS_DIR) import generate_manifest +yellow = '\033[93m' +green = '\033[92m' +end_format = '\033[0m' +bold = '\033[1m' + def main(): usage = """./tools/provision @@ -83,13 +87,8 @@ the Python version this command is executed with.""" if py_version > (3, 1): install_dependencies('py3_requirements.txt') else: - warnings.warn("Your Python version does not support mypy. `tools/run-mypy` will fail.") + print(yellow + "Your Python version does not support mypy. `tools/run-mypy` will fail." + end_format) - green = '\033[92m' - end_format = '\033[0m' - bold = '\033[1m' - - print('\n') print(green + 'Success!' + end_format) activate_command = os.path.join(base_dir,