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
Accept --gui=<...> switch in IPython qtconsole. #1707
Conversation
gui, backend = pylabtools.find_gui_and_backend(self.pylab) | ||
shell.enable_pylab(gui, import_all=self.pylab_import_all) | ||
else: | ||
shell.enable_gui(self.gui) | ||
except Exception: | ||
self.log.error("Pylab initialization failed", exc_info=True) |
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.
Should this error message be updated?
Yes, how about these error messages? |
Yep, that looks OK. |
Test results for commit 17481d8 merged into master
Not available for testing: python2.6 |
Don't the gui/pylab flags belong in the InteractiveShellApp base class? (Sorry for putting our code cleanup/consolidation on you again). |
@minrk: Yes the gui/pylab flags do belong in InteractiveShellApp but it's somewhat complicated. I've updated the pull request accordingly. |
Hm, perhaps the best way is to include 'inline' in the Enum, and define |
The behavior I implemented replaces 'inline' with 'auto' in TerminalIPythonApp. It'd be easy to raise an exception instead. Any thoughts? |
Test results for commit a327cb1 merged into master
Not available for testing: |
shell._showtraceback = _showtraceback | ||
|
||
|
||
def init_gui_pylab(self): |
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.
Does this method differ from the one in the parent, or should it be removed?
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.
Read below:
# Provide a wrapper for :meth:`InteractiveShellApp.init_gui_pylab` # to ensure that any exception is printed straight to stderr. # Normally _showtraceback associates the reply with an execution, # which means frontends will never draw it, as this exception # is not associated with any execute request.
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.
Wow, sorry about that. Nevermind.
And a warning is fine, no need for the error I mentioned. |
Can you rebase? This has developed a conflict. But after a rebase, I think it's ready. |
Rebased. The conflict was because of
in 6174cb0 |
lol, that's a rough one. I'll give this one more look over, then it should be set. |
@@ -151,6 +165,15 @@ def _extra_extension_changed(self, name, old, new): | |||
module_to_run = Unicode('', config=True, | |||
help="Run the module as a script." | |||
) | |||
gui = CaselessStrEnum(('qt', 'wx', 'gtk', 'glut', 'pyglet'), config=True, |
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.
I think 'osx' should be an option here.
Other than adding 'osx' as an option (or reminding me why that's stupid), this is ready to go. |
@@ -246,15 +235,6 @@ def _quick_changed(self, name, old, new): | |||
self.load_config_file = lambda *a, **kw: None | |||
self.ignore_old_config=True | |||
|
|||
gui = CaselessStrEnum(('qt', 'wx', 'gtk', 'glut', 'pyglet'), config=True, | |||
help="Enable GUI event loop integration ('qt', 'wx', 'gtk', 'glut', 'pyglet')." | |||
) |
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.
Regarding 'osx' as an option: I have no idea...
The list of options was formed by copy & paste from here.
If both --gui and --pylab are given, we use the value in --pylab, just like the terminal IPython application. Closes ipython#1532.
Rebased again, added Seems to work:
|
Thanks, seems to be working for me. Merging away. |
move gui/pylab to shellapp base class If both --gui and --pylab are given, we use the value in --pylab, just like the terminal IPython application. Closes #1532
move gui/pylab to shellapp base class If both --gui and --pylab are given, we use the value in --pylab, just like the terminal IPython application. Closes ipython#1532
If both --gui and --pylab are given, we use the value in --pylab, just
like the terminal IPython application.
Closes #1532.