Skip to content

Make printing a newline on finish optional#118

Merged
wolph merged 1 commit intowolph:developfrom
matthewwardrop:patch-2
May 30, 2017
Merged

Make printing a newline on finish optional#118
wolph merged 1 commit intowolph:developfrom
matthewwardrop:patch-2

Conversation

@matthewwardrop
Copy link
Copy Markdown
Contributor

Sometimes, like if the progressbar is used as part of logging, it is useful to be able to overwrite the progress bar simply using \r, which is made more difficult by this dangling newline. This PR makes that optional (the keyword argument name can be changed... chosen here to match the print function).

@wolph
Copy link
Copy Markdown
Owner

wolph commented May 26, 2017

Useful fix, thanks :)

Because of Python 2 it should be fetched from **kwargs though, otherwise it's a syntax error.

@matthewwardrop
Copy link
Copy Markdown
Contributor Author

matthewwardrop commented May 26, 2017

That's odd. It works here on my Python 2. Support for this syntax must have been added partway through the python 2.7 series. Will fix.

@wolph
Copy link
Copy Markdown
Owner

wolph commented May 26, 2017

That's odd indeed, I didn't know they backported support for keyword arguments after *args to Python 2. I was under the impression that was Python 3 only.

The fix looks great though, thanks for all the help :)

Sometimes, like if the progressbar is used as part of logging, it is useful to be able to overwrite the progress bar simply using `\r`, which is made more difficult by this dangling newline. This PR makes that optional (the keyword argument name can be changed... chosen here to match the `print` function).
@wolph wolph merged commit 3f39625 into wolph:develop May 30, 2017
wolph added a commit that referenced this pull request May 30, 2017
Fixed several bugs thanks to @matthewwardrop and refactored requirements

 - #119 Use get_ipython imported from IPython rather than global namespace
 - #118 Make printing a newline on finish optional
 - #117 Fix unwrapping stdout/stderr
 - Refactored `requirements.txt` files to use `setup.py`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants