From c46a75848bb087e6b9f55331527bc04280701029 Mon Sep 17 00:00:00 2001 From: Graeme Winter Date: Mon, 25 Nov 2024 17:05:30 +0000 Subject: [PATCH] Hide tqdm if DIALS_NOBANNER (#774) --- newsfragments/774.bugfix | 1 + src/dxtbx/model/experiment_list.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 newsfragments/774.bugfix diff --git a/newsfragments/774.bugfix b/newsfragments/774.bugfix new file mode 100644 index 000000000..6f355b5f5 --- /dev/null +++ b/newsfragments/774.bugfix @@ -0,0 +1 @@ +``dials.show``: hide tqdm if DIALS_NOBANNER diff --git a/src/dxtbx/model/experiment_list.py b/src/dxtbx/model/experiment_list.py index a2f62f4b1..9916636f5 100644 --- a/src/dxtbx/model/experiment_list.py +++ b/src/dxtbx/model/experiment_list.py @@ -676,8 +676,8 @@ def from_filenames( if format_kwargs is None: format_kwargs = {} - if os.isatty and len(filenames) > 1: - filename_iter = tqdm(to_process, total=len(filenames), file=sys.stdout) + if os.isatty and len(filenames) > 1 and "DIALS_NOBANNER" not in os.environ: + filename_iter = tqdm(to_process, total=len(filenames)) else: filename_iter = to_process