-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix jupyroot on Windows #9107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix jupyroot on Windows #9107
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,8 @@ | |
| import sys | ||
| import select | ||
| import tempfile | ||
| import pty | ||
| if not 'win32' in sys.platform: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just checked an
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fine with me |
||
| import pty | ||
| import itertools | ||
| import re | ||
| import fnmatch | ||
|
|
@@ -561,10 +562,12 @@ def _jsDisplay(self): | |
| return 0 | ||
|
|
||
| def _getPngImage(self): | ||
| ofile = tempfile.NamedTemporaryFile(suffix=".png") | ||
| ofile = tempfile.NamedTemporaryFile(suffix=".png", delete=False) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to prevent deletion via the destruction of the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To prevent the following error: See the documentation of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I see thanks! |
||
| with _setIgnoreLevel(ROOT.kError): | ||
| self.drawableObject.SaveAs(ofile.name) | ||
| img = IPython.display.Image(filename=ofile.name, format='png', embed=True) | ||
| ofile.close() | ||
| os.unlink(ofile.name) | ||
| return img | ||
|
|
||
| def _pngDisplay(self): | ||
|
|
@@ -610,7 +613,8 @@ def loadMagicsAndCapturers(): | |
| extMgr = ExtensionManager(ip) | ||
| for extName in extNames: | ||
| extMgr.load_extension(extName) | ||
| captures.append(StreamCapture()) | ||
| if not 'win32' in sys.platform: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So atm no text output is seen in the notebook if it comes from C++ code on Windows, is this right?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right |
||
| captures.append(StreamCapture()) | ||
| captures.append(CaptureDrawnPrimitives()) | ||
|
|
||
| for capture in captures: capture.register() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only effect of this is that we won't have tab completion for now, correct?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct