Skip to content

Commit

Permalink
Added a warning dialog box when attempting to convert a PNG to SVG (i…
Browse files Browse the repository at this point in the history
  • Loading branch information
icmurray committed May 17, 2012
1 parent dd5e6b7 commit 923fbdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions IPython/frontend/qt/console/rich_ipython_widget.py
Expand Up @@ -231,6 +231,10 @@ def _get_image_tag(self, match, path = None, format = "png"):
try:
svg = str(self._name_to_svg_map[match.group("name")])
except KeyError:
QtGui.QMessageBox.warning(self, 'Error converting PNG to SVG.',
'Cannot convert a PNG to SVG. To fix this, add this to your ipython config:\n'
'c.InlineBackendConfig.figure_format = \'svg\'',
QtGui.QMessageBox.Ok)
return "<b>Cannot convert a PNG to SVG. </b>To fix this, add this to your config: <span>c.InlineBackendConfig.figure_format = 'svg'</span>"

# Not currently checking path, because it's tricky to find a
Expand Down

0 comments on commit 923fbdf

Please sign in to comment.