[IPython-user] display hook
Wed May 27 07:18:01 CDT 2009
My temporary (nasty) workaround, as opposed to using set_hook():
from IPython.Prompts import CachedOutput
oldCall = CachedOutput.__call__
R.gInterpreter.EndOfLineAction() # Update graphics
CachedOutput.__call__ = DisplayHook
2009/5/27 Peter Waller <firstname.lastname@example.org>
> Dear list,
> I am trying to use IPython with a package called ROOT, and I am having
> problems with interfering display hooks. ROOT uses sys.displayhook to ensure
> that graphics are uptodate after a command is run in the interactive prompt.
> This works fine so long as ROOT is imported after IPython is started up, but
> if ROOT is imported before IPython, then IPython sets its own display hook.
> This wouldn't be a problem if IPython ran the displayhook no matter what,
> but it is conditional on whether the thing to be displayed is 'None'. If it
> is none, then the display hooks are not called. Since many of the functions
> which want to update a graphic display are returning None, my graphics are
> not being updated.
> In IPython version 0.9.1 line 533 of Prompts.py in the __call__ method of
> CachedOutput, reads "if arg is not None:", and under that if statement is
> the statement "manipulated_val = self.display(arg)". I believe that
> self.display(arg) should be called even if arg is None, so that displayhooks
> can be used to update graphics.
> Please let me know what you think,
> - Peter
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-user