Voice et bot modif
This commit is contained in:
parent
189d56026b
commit
7333a22bcd
10774 changed files with 634644 additions and 933308 deletions
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
IPython/Jupyter Notebook progressbar decorator for iterators.
|
||||
IPython/Jupyter Notebook progress bar decorator for iterators.
|
||||
Includes a default `range` iterator printing to `stderr`.
|
||||
|
||||
Usage:
|
||||
|
|
@ -20,7 +20,7 @@ if True: # pragma: no cover
|
|||
# import IPython/Jupyter base widget and display utilities
|
||||
IPY = 0
|
||||
try: # IPython 4.x
|
||||
import ipywidgets
|
||||
import ipywidgets # noqa: F401, pylint: disable=unused-import
|
||||
IPY = 4
|
||||
except ImportError: # IPython 3.x / 2.x
|
||||
IPY = 32
|
||||
|
|
@ -29,7 +29,7 @@ if True: # pragma: no cover
|
|||
warnings.filterwarnings(
|
||||
'ignore', message=".*The `IPython.html` package has been deprecated.*")
|
||||
try:
|
||||
import IPython.html.widgets as ipywidgets # NOQA: F401
|
||||
import IPython.html.widgets as ipywidgets # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ class tqdm_notebook(std_tqdm):
|
|||
pbar.value = self.n
|
||||
|
||||
if msg:
|
||||
msg = msg.replace(' ', u'\u2007') # fix html space padding
|
||||
msg = msg.replace(' ', '\u2007') # fix html space padding
|
||||
# html escape special characters (like '&')
|
||||
if '<bar/>' in msg:
|
||||
left, right = map(escape, re.split(r'\|?<bar/>\|?', msg, maxsplit=1))
|
||||
|
|
@ -247,9 +247,7 @@ class tqdm_notebook(std_tqdm):
|
|||
def __iter__(self):
|
||||
try:
|
||||
it = super().__iter__()
|
||||
for obj in it:
|
||||
# return super(tqdm...) will not catch exception
|
||||
yield obj
|
||||
yield from it
|
||||
# NB: except ... [ as ...] breaks IPython async KeyboardInterrupt
|
||||
except: # NOQA
|
||||
self.disp(bar_style='danger')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue