##// END OF EJS Templates
Fixed all broken references, refactored some stuff here and there,...
Fixed all broken references, refactored some stuff here and there, standardized nomenclature. Ready to test...

File last commit:

r10624:bfa8f97c
r10624:bfa8f97c
Show More
activatable.py
19 lines | 613 B | text/x-python | PythonLexer
from .base import ConfigurableTransformer
from IPython.utils.traitlets import (Bool)
class ActivatableTransformer(ConfigurableTransformer):
"""A simple ConfigurableTransformers that have an enabled flag
Inherit from that if you just want to have a transformer which is
no-op by default but can be activated in profiles with
c.YourTransformerName.enabled = True
"""
enabled = Bool(False, config=True)
def __call__(self, nb, other):
if not self.enabled :
return nb, other
else :
return super(ActivatableTransformer, self).__call__(nb, other)