##// END OF EJS Templates
Merge remote branch 'minrk/htmlfix' into trunk....
Merge remote branch 'minrk/htmlfix' into trunk. This branch implements a number of improvements to the HTML save capabilities of the Qt console, and received extensive reviews. A short summary follows, see the pull request page for full details, at http://github.com/ipython/ipython/pull/170. Some small issues in the HTML code I noticed when I started playing with it. * only rich backends support toHtml, so the html/xhtml exports failed * modules were imported inside functions * relpath in image_tag was determined in platform-dependent way * save dialog strictly enforced non-standard '.htm' file extension * when selecting external PNG, the _files dir was always created, regardless of whether there were any images Fixes in this commit: * export options do not appear in non-rich widgets * module imports all at the top * relpath uses platform independent os.path * dialog uses standard '.html' by default, but allows any extension * no _files dir is created if no images are to be exported Closes gh-170 (pull request).

File last commit:

r2827:34964c21
r3177:35e407aa merge
Show More
backend_payload.py
26 lines | 740 B | text/x-python | PythonLexer
""" Provides basic funtionality for payload backends.
"""
# Local imports.
from IPython.core.interactiveshell import InteractiveShell
def add_plot_payload(format, data, metadata={}):
""" Add a plot payload to the current execution reply.
Parameters:
-----------
format : str
Identifies the format of the plot data.
data : str
The raw plot data.
metadata : dict, optional [default empty]
Allows for specification of additional information about the plot data.
"""
payload = dict(
source='IPython.zmq.pylab.backend_payload.add_plot_payload',
format=format, data=data, metadata=metadata
)
InteractiveShell.instance().payload_manager.write_payload(payload)