Skip newlines in TTY AND ipykernel.
* 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
@@ -267,6 +267,7 @@ class Progbar(object):
self.total_width = 0
self.seen_so_far = 0
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:
