Release notes and updates to GUI support docs for 0.11 #620

Merged
merged 29 commits into from Jul 30, 2011

Projects

None yet

6 participants

@fperez
IPython member

This is NOT quite ready for merge, but we need a place to discuss and fine-tune this code until we can merge it. Note that this PR supersedes #599, which I've merged already here. See #599 for some useful discussion on the GUI code.

The main question I have ATM is how to best present our gui support examples, so they work with and without ipython. The code that was there (taking the gui-qt example for illustration) read:

try:
    from IPython.lib.inputhook import enable_qt4; enable_qt4(app)
except ImportError:
    app.exec_()

but the problem is that, if a user has IPython installed, this will fail to provide a working script, as the import will succeed but the app won't be correctly executed.

Alternatively, one can use:

try:
    from IPython.lib.guisupport import start_event_loop_qt4
    start_event_loop_qt4(app)
except ImportError:
    app.exec_()

which does work correctly if IPython's gui support has already been activated (via %gui qt or at the cmd line via --gui=qt).

The only drawback to approach #2 is that the user must remember to first activate the gui support, as that will do the PyOSInputHook tricks that are needed. But it means that the code works both inside IPython and outside of it.

Therefore I favor changing all our gui-* examples to this approach, but I'd like some feedback, especially from @ellisonbg and @epatters, who put a lot of thought into this, before merging.

I'll continue updating the docs until we can merge this, but this issue straddles documentation and code so we need to sort it out before I can completely finish the docs.

@takluyver
IPython member

Why not simply tweak the start_event_loop_qt4 code so that it enables our GUI integration before calling app.exec_()? Presumably this has no ill effects if our REPL isn't active?

@fperez
IPython member

You read my mind :) I'm precisely looking into the code to do that right now.

@ellisonbg ellisonbg and 1 other commented on an outdated diff Jul 23, 2011
IPython/lib/guisupport.py
@@ -132,6 +132,8 @@ def start_event_loop_qt4(app=None):
if app is None:
app = get_app_qt4([''])
if not is_event_loop_running_qt4(app):
+ from .inputhook import enable_qt4
+ #enable_qt4(app)
@ellisonbg
ellisonbg Jul 23, 2011

Should this be removed? Also, guisupport, which is designed to be completely general, should not use things from inputhook, which is just for the terminal.

@fperez
fperez Jul 23, 2011

Yes, I was just experimenting here and left that when I uploaded. This is definitely getting removed. Thanks for the careful check!

@ellisonbg
IPython member

Comments about reference.txt in the Sphinx docs:

  • The discussion about the GUI support at the bottom of the file is exclusively focused on the GUI support in the terminal. This will mislead user's into thinking that the %gui magic will work in all frontends. This section needs to be split into two sections, one for the terminal based FE and another for the other Kernel based FEs. The kernel based FE section should discuss the guisupport module.
  • This file still discusses the PhysicalQInput, which we are removed. The docs for this should be removed.
@ellisonbg
IPython member

Most of the example still use the inputhook approach. Do we want to move these to use guisupport, at least for the toolkits where it makes sense?

@fperez
IPython member

Re reference.txt: thanks for the notes, I'll take these into account.

Re examples: yes, I'm going to experiment and if it works for the others, I'll do that. I wanted to understand the problem with Qt first, but that seems to be the best approach.

@takluyver
IPython member

I've removed the docs section on PhysicalQInteractive in master.

@ellisonbg
IPython member

As part of updating the GUI support docs, we should update this page:

http://ipython.org/ipython-doc/dev/interactive/qtconsole.html

To indicate that pastefig has been replaced by display and getfigs. Probably should just describe display and getfigs and remove refs to pastefig.

@minrk
IPython member

I just updated the pastefig section to reference display.

takluyver and others added some commits Jul 20, 2011
@takluyver takluyver Update gui-qt.py example file so it works with the new Qt GUI support. 73bd399
@fperez fperez Remove Itpl from deathrow, since we carry a copy in externals. 047db5d
@fperez fperez Removed mpl example that wasn't really illustrating anything. d75ba37
@takluyver takluyver Corrections to documentation of GUI event loop support. a671f7d
@takluyver takluyver Various corrections to interactive reference docs; removed informatio…
…n on shadow history.
5dc68a3
@takluyver takluyver Remove unnecessary code from gui-qt.py example 7319f2b
@fperez fperez Improve what's new document, closer to release form... c7c4b00
@fperez fperez Make gui support code and examples uniform and all working correctly.
Note that this has changed a little bit the API, as now all the
inputhook.enable* methods all take an optional app object instead of a
boolean flag.
4877ed3
@fperez fperez Fix installation of manpages. 6d5ab9a
@fperez fperez Small fix to docstring and qt example. fc3585e
@fperez fperez Finish outline of main parts. f786fa4
@fperez fperez Put all figures in figs/ subdirectory 6affd62
@fperez fperez Add Qt console screenshot. 09f7328
@fperez fperez Checkpoint for feedback from Thomas. 9c825e3
@fperez fperez Reflow text before editing, no content changes. 7fb374d
@fperez fperez Improve stats script to better summarize pull requests. 2f65368
@fperez fperez Continue release notes drafting, add full bug stats. a610b53
@fperez fperez Add Visual Studio integration screenshot.
Many thanks to Dino Viehland and Sharokh Mortazavi, from Microsoft,
for the work that went into making this possible.
31452d5
@tomspur tomspur Fix bare print calls that were missing '()'.
These were causing a missing newline on exit.

Closes gh-637, slightly modified from the original version, as there
was one more print elsewhere in the file.
38c425a
@fperez fperez Remove obsolte information from docstrings. 5d84297
@jseabold jseabold Updated Sphinx extension ipython_directive to work with 0.11. 404d033
@fperez fperez Cleanup stats script and make it print report in final, usable form. 8ad4bd5
@fperez fperez Small docstring/usage message cleanups. 17d3458
@fperez fperez Lots more edits to release notes, nearing completion. 0bc7eb9
@fperez fperez Restore Demo example (and tested that it works) 653200d
@fperez fperez Update docs logo to our current one, other minor fixes. b5b17b2
@fperez fperez Print correct error message if user types in %gui in the zmq shell. 3f5eec2
@fperez fperez Fix manual section about pasting code with prompts. 28b55d9
@fperez fperez Update notes about GUI event loop support. 7a11566
@fperez fperez merged commit 7a11566 into ipython:master Jul 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment