##// END OF EJS Templates
Lowercased format argument to image_tag
Mark Voorhies -
Show More
@@ -544,7 +544,7 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
544 544 # predictable...
545 545 img_re = re.compile(r'<img src="(?P<name>[\d]+)" />')
546 546 f.write(img_re.sub(
547 lambda x: self.image_tag(x, path = path, format = "PNG"),
547 lambda x: self.image_tag(x, path = path, format = "png"),
548 548 str(self._control.toHtml().toUtf8())))
549 549 finally:
550 550 f.close()
@@ -574,7 +574,7 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
574 574 html = ('<html xmlns="http://www.w3.org/1999/xhtml">\n'+
575 575 html[offset+6:])
576 576 f.write(img_re.sub(
577 lambda x: self.image_tag(x, path = None, format = "SVG"),
577 lambda x: self.image_tag(x, path = None, format = "svg"),
578 578 html))
579 579 finally:
580 580 f.close()
@@ -132,7 +132,7 b' class RichIPythonWidget(IPythonWidget):'
132 132 (e.g., link, embedded image, ...). As a side effect, files may
133 133 be generated in the directory given by path."""
134 134
135 if(format == "PNG"):
135 if(format == "png"):
136 136 try:
137 137 image = self._get_image(match.group("name"))
138 138 except KeyError:
@@ -156,7 +156,7 b' class RichIPythonWidget(IPythonWidget):'
156 156 return '<img src="data:image/png;base64,\n%s\n" />' % (
157 157 re.sub(r'(.{60})',r'\1\n',str(ba.toBase64())))
158 158
159 elif(format == "SVG"):
159 elif(format == "svg"):
160 160 try:
161 161 svg = str(self._name_to_svg[match.group("name")])
162 162 except KeyError:
General Comments 0
You need to be logged in to leave comments. Login now