Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Check for Jupyter Notebook before allocating other terminal sizes.#103

Merged
wolph merged 2 commits into
wolph:developwolph/python-progressbar:developfrom
matthewwardrop:patch-1matthewwardrop/python-progressbar:patch-1Copy head branch name to clipboard
Mar 27, 2017
Merged

Check for Jupyter Notebook before allocating other terminal sizes.#103
wolph merged 2 commits into
wolph:developwolph/python-progressbar:developfrom
matthewwardrop:patch-1matthewwardrop/python-progressbar:patch-1Copy head branch name to clipboard

Conversation

@matthewwardrop

@matthewwardrop matthewwardrop commented Mar 24, 2017

Copy link
Copy Markdown
Contributor

Currently, the number of columns and rows used by progressbar2 in Jupyter notebooks is inherited from the shell from which it was run... which leads to some pretty weird behaviour. Instead, I think we should check for Jupyter notebooks first.

Is there ever a case where this doesn't make sense?

@wolph

Currently, the number of columns and rows used by `progressbar2` in Jupyter notebooks is inherited from the shell from which it was run... which leads to some pretty weird behaviour. Instead, I think we should check for Jupyter notebooks first.

Is there ever a case where this doesn't make sense?
@wolph

wolph commented Mar 24, 2017

Copy link
Copy Markdown
Owner

Is there ever a case where this doesn't make sense?

Yes, actually... the ipython commanline shell. Detecting the terminal size is very error prone and I haven't found a good way to detect if we are within a Jupyter notebook which is why the method is only used as fallback.

This fix unfortunately "breaks" behavior in ipython which is not ideal either.

@matthewwardrop

matthewwardrop commented Mar 25, 2017

Copy link
Copy Markdown
Contributor Author

Hmmm... That's odd. When I checked this before, ZMQ is not used for the command line shell.

In [1]: get_ipython()
Out[1]: <IPython.terminal.interactiveshell.TerminalInteractiveShell at 0x10bca3b00>`

Is it different on non-UNIX platforms?

@wolph

wolph commented Mar 27, 2017

Copy link
Copy Markdown
Owner

You're right, my mind was somehow stuck in the past before jupyter detection was fixed properly. This fix works just fine :)

@wolph wolph merged commit 6a59fc6 into wolph:develop Mar 27, 2017
@matthewwardrop

matthewwardrop commented Mar 28, 2017

Copy link
Copy Markdown
Contributor Author

No worries! Now I can remove my downstream hacks .... or at least, some of them! May submit some other patches at some point :). Thanks @wolph!

@matthewwardrop matthewwardrop deleted the patch-1 branch March 28, 2017 03:40
@wolph

wolph commented Mar 30, 2017

Copy link
Copy Markdown
Owner

I've pushed out a new release so you can now install progressbar2 3.16.1 :)

@matthewwardrop

Copy link
Copy Markdown
Contributor Author

Thanks!

@matthewwardrop

Copy link
Copy Markdown
Contributor Author

Hi @wolph. This PR seems to have gone missing despite being merged. Can you confirm?

@wolph

wolph commented Apr 14, 2017

Copy link
Copy Markdown
Owner

I honestly have no clue what happened here... it's not in the develop or master branch and doesn't appear to be in the history either. Since I've merged it using the Github pull request interface I'm pretty sure I didn't muck up anything locally but it's still missing somehow.

Very odd... I'll reapply your changes and create a new release

@matthewwardrop

Copy link
Copy Markdown
Contributor Author

Thanks @wolph!

That is very odd indeed :). Anyway... all looks good now! Thanks again.

@matthewwardrop

Copy link
Copy Markdown
Contributor Author

@wolph This patch has gone missing again. 🤒

wolph added a commit that referenced this pull request May 25, 2017
Reaplying @matthewwardrop his pull request #103 v3.20.1
@wolph

wolph commented May 25, 2017

Copy link
Copy Markdown
Owner

How... why :(
The commit is somehow actually disappearing from git every time.

I've manually downloaded the patch and re-applied it using git apply instead of cherry-picking it again

@wolph

wolph commented May 25, 2017

Copy link
Copy Markdown
Owner

It's definitely in v3.20.1 now :)

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.