Show More
@@ -18,7 +18,7 b' from .utils import highlight, ansi2html' | |||||
18 | from .utils import markdown2latex |
|
18 | from .utils import markdown2latex | |
19 |
|
19 | |||
20 | from IPython.config.configurable import Configurable |
|
20 | from IPython.config.configurable import Configurable | |
21 |
from IPython.utils.traitlets import |
|
21 | from IPython.utils.traitlets import List | |
22 |
|
22 | |||
23 | #----------------------------------------------------------------------------- |
|
23 | #----------------------------------------------------------------------------- | |
24 | # Class declarations |
|
24 | # Class declarations |
@@ -50,7 +50,7 b' texenv = Environment(' | |||||
50 | # IPython imports |
|
50 | # IPython imports | |
51 | from IPython.nbformat import current as nbformat |
|
51 | from IPython.nbformat import current as nbformat | |
52 | from IPython.config.configurable import Configurable |
|
52 | from IPython.config.configurable import Configurable | |
53 |
from IPython.utils.traitlets import ( Unicode, |
|
53 | from IPython.utils.traitlets import ( Unicode, List, Bool) | |
54 |
|
54 | |||
55 | #----------------------------------------------------------------------------- |
|
55 | #----------------------------------------------------------------------------- | |
56 | # Class declarations |
|
56 | # Class declarations |
@@ -20,7 +20,7 b' class ConfigurableTransformers(Configurable):' | |||||
20 | for index, cell in enumerate(worksheet.cells): |
|
20 | for index, cell in enumerate(worksheet.cells): | |
21 | worksheet.cells[index], other = self.cell_transform(cell, other, index) |
|
21 | worksheet.cells[index], other = self.cell_transform(cell, other, index) | |
22 | return nb, other |
|
22 | return nb, other | |
23 |
except NotImplementedError |
|
23 | except NotImplementedError: | |
24 | raise NotImplementedError('should be implemented by subclass') |
|
24 | raise NotImplementedError('should be implemented by subclass') | |
25 |
|
25 | |||
26 | def cell_transform(self, cell, other, index): |
|
26 | def cell_transform(self, cell, other, index): | |
@@ -121,11 +121,11 b' class ExtractFigureTransformer(ActivatableTransformer):' | |||||
121 | def cell_transform(self, cell, other, count): |
|
121 | def cell_transform(self, cell, other, count): | |
122 | if other.get('figures',None) is None : |
|
122 | if other.get('figures', None) is None : | |
123 | other['figures']={} |
|
123 | other['figures'] = {} | |
124 |
for |
|
124 | for out in cell.get('outputs', []): | |
125 | for type in self.display_data_priority: |
|
125 | for out_type in self.display_data_priority: | |
126 | if out.hasattr(type): |
|
126 | if out.hasattr(out_type): | |
127 | figname, key, data = self._new_figure(out[type], type, count) |
|
127 | figname, key, data = self._new_figure(out[out_type], out_type, count) | |
128 | out['key_'+type] = figname |
|
128 | out['key_'+out_type] = figname | |
129 | other['figures'][key] = data |
|
129 | other['figures'][key] = data | |
130 | count = count+1 |
|
130 | count = count+1 | |
131 | return cell, other |
|
131 | return cell, other |
General Comments 0
You need to be logged in to leave comments.
Login now