Skip to content

Commit d0251a0

Browse files
committed
Improve display of progressbar wrt. being interrupted by logging output
1 parent da95db2 commit d0251a0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ in progress
99
- Update dependencies to their most recent versions.
1010
- Add URLs to dashboard variables and panel view/edit pages to the output of
1111
the ``find`` subcommand. Thanks, @oplehto.
12+
- Improve display of progressbar wrt. being interrupted by logging output.
1213

1314
2022-06-19 0.13.4
1415
=================

grafana_wtf/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from collections import OrderedDict
1010
from concurrent.futures.thread import ThreadPoolExecutor
1111
from urllib.parse import parse_qs, urljoin, urlparse
12+
from tqdm.contrib.logging import tqdm_logging_redirect
1213

1314
import colored
1415
import requests
@@ -108,7 +109,8 @@ def setup(self):
108109

109110
def start_progressbar(self, total):
110111
if self.progressbar:
111-
self.taqadum = tqdm(total=total)
112+
with tqdm_logging_redirect():
113+
self.taqadum = tqdm(total=total)
112114

113115
def scan_common(self):
114116
self.scan_dashboards()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'dataclasses; python_version<"3.7"',
1313
"docopt>=0.6.2,<0.7",
1414
"munch>=2.5.0,<3",
15-
"tqdm>=4.37.0,<5",
15+
"tqdm>=4.60.0,<5",
1616
# Grafana
1717
"requests>=2.23.0,<3",
1818
"grafana-client>=2.1.0,<4",

0 commit comments

Comments
 (0)