From 6712bd9c93a477a035b9d09a9703739fa6c0fd70 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 14 Oct 2021 17:33:35 +0530 Subject: [PATCH] fix: Leaking color in bench --help Since the character to render NC was cut off due to the char limit, the whole list of following commands and descriptions would also turn yellow. Let's keep it colourless in --help. Only, make it yellow when the command is executed directly. --- frappe/commands/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 03713c9632..416f014164 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -12,10 +12,9 @@ from frappe.exceptions import SiteNotSpecifiedError from frappe.utils import update_progress_bar, cint from frappe.coverage import CodeCoverage -DATA_IMPORT_DEPRECATION = click.style( +DATA_IMPORT_DEPRECATION = ( "[DEPRECATED] The `import-csv` command used 'Data Import Legacy' which has been deprecated.\n" - "Use `data-import` command instead to import data via 'Data Import'.", - fg="yellow" + "Use `data-import` command instead to import data via 'Data Import'." ) @@ -364,7 +363,7 @@ def import_doc(context, path, force=False): @click.option('--no-email', default=True, is_flag=True, help='Send email if applicable') @pass_context def import_csv(context, path, only_insert=False, submit_after_import=False, ignore_encoding_errors=False, no_email=True): - click.secho(DATA_IMPORT_DEPRECATION) + click.secho(DATA_IMPORT_DEPRECATION, fg="yellow") sys.exit(1)