提交 3fe52549 编写于 作者: S Simon Gate 提交者: François Chollet

Skip newlines in TTY AND ipykernel. (#8318)

* Skip newlines in TTY AND ipykernel.

After the addition of tty check output was ruined in jupyter. Go back to
the old ways when running jupyter notebooks and ipython.

* Trigger travis

* Only check for ipykernel once when initiating progbar

* Add colon
上级 e5f2fb78
......@@ -266,7 +266,8 @@ class Progbar(object):
self.interval = interval
self.total_width = 0
self.seen_so_far = 0
self.verbose = verbose
self.verbose = verbose
self.is_jupyter = 'ipykernel' in sys.modules
def update(self, current, values=None, force=False):
"""Updates the progress bar.
......@@ -296,7 +297,7 @@ class Progbar(object):
return
prev_total_width = self.total_width
if sys.stdout.isatty():
if sys.stdout.isatty() or self.is_jupyter:
sys.stdout.write('\b' * prev_total_width)
sys.stdout.write('\r')
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册