From 9afdf3798f5c1ef2ae4c8e18da225be7e1a524d2 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 13 Jul 2023 22:54:35 +0200 Subject: [PATCH] strip spaces; added quotation marks --- slic/core/acquisition/broker_tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slic/core/acquisition/broker_tools.py b/slic/core/acquisition/broker_tools.py index 95ae2c05..23dc5206 100644 --- a/slic/core/acquisition/broker_tools.py +++ b/slic/core/acquisition/broker_tools.py @@ -109,6 +109,7 @@ class get_current_pulseid(): def clean_output_dir(s, default="_", allowed=ALLOWED_CHARS): if s is None: return None + s = s.strip() res = "".join(i if i in allowed else default for i in s) if res != s: warn_output_dir(s, res) @@ -117,9 +118,9 @@ def clean_output_dir(s, default="_", allowed=ALLOWED_CHARS): def warn_output_dir(old, new): old, new = mark_differences(old, new) cprint("output dir contains forbidden characters. will adjust:", color="cyan") - print(old) + print(f'"{old}"') cprint("==>", color="cyan") - print(new) + print(f'"{new}"') def mark_differences(a, b): a2 = []