summaryrefslogtreecommitdiffstats
path: root/tqdm/gui.py
diff options
context:
space:
mode:
Diffstat (limited to 'tqdm/gui.py')
-rw-r--r--tqdm/gui.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/tqdm/gui.py b/tqdm/gui.py
index 4612701..8bab6ac 100644
--- a/tqdm/gui.py
+++ b/tqdm/gui.py
@@ -8,16 +8,14 @@ Usage:
"""
# future division is important to divide integers and get as
# a result precise floating numbers (instead of truncated int)
-from __future__ import absolute_import, division
-
import re
from warnings import warn
# to inherit from the tqdm class
from .std import TqdmExperimentalWarning
from .std import tqdm as std_tqdm
+
# import compatibility functions and utilities
-from .utils import _range
__author__ = {"github.com/": ["casperdcl", "lrq3000"]}
__all__ = ['tqdm_gui', 'tgrange', 'tqdm', 'trange']
@@ -173,17 +171,14 @@ class tqdm_gui(std_tqdm): # pragma: no cover
"{bar}", "<bar/>")
msg = self.format_meter(**d)
if '<bar/>' in msg:
- msg = "".join(re.split(r'\|?<bar/>\|?', msg, 1))
+ msg = "".join(re.split(r'\|?<bar/>\|?', msg, maxsplit=1))
ax.set_title(msg, fontname="DejaVu Sans Mono", fontsize=11)
self.plt.pause(1e-9)
def tgrange(*args, **kwargs):
- """
- A shortcut for `tqdm.gui.tqdm(xrange(*args), **kwargs)`.
- On Python3+, `range` is used instead of `xrange`.
- """
- return tqdm_gui(_range(*args), **kwargs)
+ """Shortcut for `tqdm.gui.tqdm(range(*args), **kwargs)`."""
+ return tqdm_gui(range(*args), **kwargs)
# Aliases