From 77f4b8115c109a4002cd58aa8ba069ed53f0a42e Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Fri, 28 Jul 2023 18:46:33 +0300 Subject: [PATCH] Add missing reset ANSI sequence Do not forget to reset the red text once we print an error string to the terminal --- dangerzone/isolation_provider/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dangerzone/isolation_provider/base.py b/dangerzone/isolation_provider/base.py index 9f55ca8..aa02c54 100644 --- a/dangerzone/isolation_provider/base.py +++ b/dangerzone/isolation_provider/base.py @@ -53,12 +53,12 @@ class IsolationProvider(ABC): self, document: Document, error: bool, text: str, percentage: float ) -> None: s = Style.BRIGHT + Fore.YELLOW + f"[doc {document.id}] " - s += Fore.CYAN + f"{percentage}% " + s += Fore.CYAN + f"{percentage}% " + Style.RESET_ALL if error: - s += Style.RESET_ALL + Fore.RED + text + s += Fore.RED + text + Style.RESET_ALL log.error(s) else: - s += Style.RESET_ALL + text + s += text log.info(s) if self.progress_callback: