From fa6b6a7bb5303a65a500f08da8a89c7af204f416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 7 Feb 2022 15:01:17 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Backport=20test=20for=20#4392?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/util/commandline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/octoprint/util/commandline.py b/src/octoprint/util/commandline.py index 729d2ff1d..81110e80a 100644 --- a/src/octoprint/util/commandline.py +++ b/src/octoprint/util/commandline.py @@ -60,6 +60,9 @@ def clean_ansi(line): >>> text = "We \x1b[?25lhide the cursor here and then \x1b[?25hshow it again here in unicode" >>> clean_ansi(text) # doctest: +ALLOW_BYTES 'We hide the cursor here and then show it again here in unicode' + >>> test = "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 1.1 MB/s eta 0:00:00" + >>> clean_ansi(text) # doctest: +ALLOW_BYTES + '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 1.1 MB/s eta 0:00:00' """ if isinstance(line, unicode): return _ANSI_REGEX["unicode"].sub("", line)