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