Show More
@@ -29,6 +29,9 b' class RichIPythonWidget(IPythonWidget):' | |||
|
29 | 29 | # RichIPythonWidget protected class variables. |
|
30 | 30 | _payload_source_plot = 'IPython.zmq.pylab.backend_payload.add_plot_payload' |
|
31 | 31 | _jpg_supported = Bool(False) |
|
32 | ||
|
33 | # Used to determine whether a given html export attempt has already | |
|
34 | # displayed a warning about being unable to convert a png to svg. | |
|
32 | 35 | _svg_warning_displayed = False |
|
33 | 36 | |
|
34 | 37 | #--------------------------------------------------------------------------- |
@@ -61,7 +64,8 b' class RichIPythonWidget(IPythonWidget):' | |||
|
61 | 64 | def export_html(self): |
|
62 | 65 | """ Shows a dialog to export HTML/XML in various formats. |
|
63 | 66 | |
|
64 |
Overridden in order to reset the _svg_warning_displayed flag |
|
|
67 | Overridden in order to reset the _svg_warning_displayed flag prior | |
|
68 | to the export running. | |
|
65 | 69 | """ |
|
66 | 70 | self._svg_warning_displayed = False |
|
67 | 71 | super(RichIPythonWidget, self).export_html() |
@@ -248,12 +252,16 b' class RichIPythonWidget(IPythonWidget):' | |||
|
248 | 252 | except KeyError: |
|
249 | 253 | if not self._svg_warning_displayed: |
|
250 | 254 | QtGui.QMessageBox.warning(self, 'Error converting PNG to SVG.', |
|
251 |
'Cannot convert a PNG to SVG. To fix this, add this |
|
|
255 | 'Cannot convert a PNG to SVG. To fix this, add this ' | |
|
256 | 'to your ipython config:\n\n' | |
|
252 | 257 | '\tc.InlineBackendConfig.figure_format = \'svg\'\n\n' |
|
253 | 258 | 'And regenerate the figures.', |
|
254 | 259 | QtGui.QMessageBox.Ok) |
|
255 | 260 | self._svg_warning_displayed = True |
|
256 | return "<b>Cannot convert a PNG to SVG. </b>To fix this, add this to your config: <span>c.InlineBackendConfig.figure_format = 'svg'</span> and regenerate the figures." | |
|
261 | return ("<b>Cannot convert a PNG to SVG.</b> " | |
|
262 | "To fix this, add this to your config: " | |
|
263 | "<span>c.InlineBackendConfig.figure_format = 'svg'</span> " | |
|
264 | "and regenerate the figures.") | |
|
257 | 265 | |
|
258 | 266 | # Not currently checking path, because it's tricky to find a |
|
259 | 267 | # cross-browser way to embed external SVG images (e.g., via |
General Comments 0
You need to be logged in to leave comments.
Login now