Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lowercased format argument to image_tag

  • Loading branch information...
commit fa1c6f4bac1dc833c615b915421db3b2715f2f51 1 parent 35277cb
markvoorhies authored
4 IPython/frontend/qt/console/console_widget.py
View
@@ -544,7 +544,7 @@ def export_html(self, parent = None, inline = False):
# predictable...
img_re = re.compile(r'<img src="(?P<name>[\d]+)" />')
f.write(img_re.sub(
- lambda x: self.image_tag(x, path = path, format = "PNG"),
+ lambda x: self.image_tag(x, path = path, format = "png"),
str(self._control.toHtml().toUtf8())))
finally:
f.close()
@@ -574,7 +574,7 @@ def export_xhtml(self, parent = None):
html = ('<html xmlns="http://www.w3.org/1999/xhtml">\n'+
html[offset+6:])
f.write(img_re.sub(
- lambda x: self.image_tag(x, path = None, format = "SVG"),
+ lambda x: self.image_tag(x, path = None, format = "svg"),
html))
finally:
f.close()
4 IPython/frontend/qt/console/rich_ipython_widget.py
View
@@ -132,7 +132,7 @@ def image_tag(self, match, path = None, format = "PNG"):
(e.g., link, embedded image, ...). As a side effect, files may
be generated in the directory given by path."""
- if(format == "PNG"):
+ if(format == "png"):
try:
image = self._get_image(match.group("name"))
except KeyError:
@@ -156,7 +156,7 @@ def image_tag(self, match, path = None, format = "PNG"):
return '<img src="data:image/png;base64,\n%s\n" />' % (
re.sub(r'(.{60})',r'\1\n',str(ba.toBase64())))
- elif(format == "SVG"):
+ elif(format == "svg"):
try:
svg = str(self._name_to_svg[match.group("name")])
except KeyError:
Please sign in to comment.
Something went wrong with that request. Please try again.