##// END OF EJS Templates
make ExtracfigureTransformer Activable
Matthias BUSSONNIER -
Show More
@@ -31,10 +31,10 b' class ConfigurableTransformers(Configurable):'
31
31
32 class ActivatableTransformer(ConfigurableTransformers):
32 class ActivatableTransformer(ConfigurableTransformers):
33
33
34 active = Bool(False, config=True)
34 enabled = Bool(False, config=True)
35
35
36 def __call__(self, nb, other):
36 def __call__(self, nb, other):
37 if not self.active :
37 if not self.enabled :
38 return nb,other
38 return nb,other
39 else :
39 else :
40 return super(ActivatableTransformer,self).__call__(nb, other)
40 return super(ActivatableTransformer,self).__call__(nb, other)
@@ -77,10 +77,6 b' def haspyout_transformer(cell, other, count):'
77 # todo, make the key part configurable.
77 # todo, make the key part configurable.
78
78
79 class ExtractFigureTransformer(ActivatableTransformer):
79 class ExtractFigureTransformer(ActivatableTransformer):
80 enabled = Bool(False,
81 config=True,
82 help=""" If set to false, this transformer will be no-op """
83 )
84
80
85 extra_ext_map = Dict({},
81 extra_ext_map = Dict({},
86 config=True,
82 config=True,
@@ -122,8 +118,6 b' class ExtractFigureTransformer(ActivatableTransformer):'
122
118
123
119
124 def cell_transform(self, cell, other, count):
120 def cell_transform(self, cell, other, count):
125 if not self.enabled:
126 return cell, other
127 if other.get('figures',None) is None :
121 if other.get('figures',None) is None :
128 other['figures']={}
122 other['figures']={}
129 for i, out in enumerate(cell.get('outputs', [])):
123 for i, out in enumerate(cell.get('outputs', [])):
General Comments 0
You need to be logged in to leave comments. Login now