From 425cd964485938fc0bfe2faba8f6a9de4af32b0b 2013-06-11 21:04:26 From: Matthias Bussonnier Date: 2013-06-11 21:04:26 Subject: [PATCH] Merge pull request #179 from Carreau/global-configurable Restaure Global configurable --- 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 diff --git a/nbconvert1/converters/config.py b/nbconvert/utils/config.py similarity index 100% rename from nbconvert1/converters/config.py rename to nbconvert/utils/config.py