From f69165a2dfd00cbf9e0fb3629b0703564544827a 2013-06-04 17:07:12 From: Matthias BUSSONNIER Date: 2013-06-04 17:07:12 Subject: [PATCH] restore globalconfigurable --- diff --git a/nbconvert.py b/nbconvert.py index 503570a..b6c3096 100755 --- a/nbconvert.py +++ b/nbconvert.py @@ -31,6 +31,7 @@ from IPython.utils.traitlets import (Bool) from nbconvert.exporters.export import export_by_name from nbconvert.exporters.exporter import Exporter from nbconvert.transformers import extractfigure +from nbconvert.utils.config import GlobalConfigurable #----------------------------------------------------------------------------- #Globals and constants @@ -93,6 +94,7 @@ class NbConvertApp(Application): #Register class here to have help with help all self.classes.insert(0, Exporter) + self.classes.insert(0, GlobalConfigurable) def start(self, argv=None): diff --git a/nbconvert/filters/datatypefilter.py b/nbconvert/filters/datatypefilter.py index eb6a471..f4fff8f 100755 --- a/nbconvert/filters/datatypefilter.py +++ b/nbconvert/filters/datatypefilter.py @@ -17,7 +17,9 @@ GlobalConfigurable.display_data_priority # Classes and functions #----------------------------------------------------------------------------- -class DataTypeFilter(object): +from ..utils.config import GlobalConfigurable + +class DataTypeFilter(GlobalConfigurable): """ Returns the preferred display format """ display_data_priority = ['html', 'pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg' , 'text'] @@ -28,4 +30,4 @@ class DataTypeFilter(object): for fmt in self.display_data_priority: if fmt in output: return [fmt] - return [] \ No newline at end of file + return [] diff --git a/nbconvert/transformers/base.py b/nbconvert/transformers/base.py index 3efed7a..652cc9a 100755 --- a/nbconvert/transformers/base.py +++ b/nbconvert/transformers/base.py @@ -19,12 +19,13 @@ It exposes a convenient class to inherit from to access configurability. from __future__ import print_function, absolute_import from IPython.config.configurable import Configurable +from ..utils.config import GlobalConfigurable #----------------------------------------------------------------------------- # Classes and Functions #----------------------------------------------------------------------------- -class ConfigurableTransformer(Configurable): +class ConfigurableTransformer(GlobalConfigurable): """ A configurable transformer Inherit from this class if you wish to have configurability for your