diff --git a/IPython/nbconvert/exporters/tests/cheese.py b/IPython/nbconvert/exporters/tests/cheese.py index cb801d0..beddc7d 100644 --- a/IPython/nbconvert/exporters/tests/cheese.py +++ b/IPython/nbconvert/exporters/tests/cheese.py @@ -32,7 +32,7 @@ class CheeseTransformer(Transformer): super(CheeseTransformer, self).__init__(**kw) - def call(self, nb, resources): + def transform(self, nb, resources): """ Sphinx transformation to apply on each notebook. diff --git a/IPython/nbconvert/post_processors/base.py b/IPython/nbconvert/post_processors/base.py index 4f709b3..3c720b3 100644 --- a/IPython/nbconvert/post_processors/base.py +++ b/IPython/nbconvert/post_processors/base.py @@ -23,13 +23,13 @@ class PostProcessorBase(NbConvertBase): def __call__(self, input): """ - See def call() ... + See def postprocess() ... """ - self.call(input) + self.postprocess(input) - def call(self, input): + def postprocess(self, input): """ Post-process output from a writer. """ - raise NotImplementedError('call') + raise NotImplementedError('postprocess') diff --git a/IPython/nbconvert/post_processors/pdf.py b/IPython/nbconvert/post_processors/pdf.py index 268aa4d..53062f3 100644 --- a/IPython/nbconvert/post_processors/pdf.py +++ b/IPython/nbconvert/post_processors/pdf.py @@ -37,7 +37,7 @@ class PDFPostProcessor(PostProcessorBase): Whether or not to display the output of the compile call. """) - def call(self, input): + def postprocess(self, input): """ Consume and write Jinja output a PDF. See files.py for more... diff --git a/IPython/nbconvert/post_processors/serve.py b/IPython/nbconvert/post_processors/serve.py index 6d9b5fb..828f5f3 100644 --- a/IPython/nbconvert/post_processors/serve.py +++ b/IPython/nbconvert/post_processors/serve.py @@ -34,7 +34,7 @@ class ServePostProcessor(PostProcessorBase): help="""Set to False to deactivate the opening of the browser""") - def call(self, input): + def postprocess(self, input): """ Simple implementation to serve the build directory. """ diff --git a/IPython/nbconvert/transformers/base.py b/IPython/nbconvert/transformers/base.py index b0f9155..d38df62 100755 --- a/IPython/nbconvert/transformers/base.py +++ b/IPython/nbconvert/transformers/base.py @@ -33,7 +33,7 @@ class Transformer(NbConvertBase): using c.SubClassName.atribute=value you can overwrite :meth:`transform_cell` to apply a transformation independently on each cell - or :meth:`call` if you prefer your own logic. See corresponding docstring for informations. + or :meth:`transform` if you prefer your own logic. See corresponding docstring for informations. Disabled by default and can be enabled via the config by 'c.YourTransformerName.enabled = True' @@ -58,12 +58,12 @@ class Transformer(NbConvertBase): def __call__(self, nb, resources): if self.enabled: - return self.call(nb,resources) + return self.transform(nb,resources) else: return nb, resources - def call(self, nb, resources): + def transform(self, nb, resources): """ Transformation to apply on each notebook. diff --git a/IPython/nbconvert/transformers/csshtmlheader.py b/IPython/nbconvert/transformers/csshtmlheader.py index 7f33fa9..f7762a2 100755 --- a/IPython/nbconvert/transformers/csshtmlheader.py +++ b/IPython/nbconvert/transformers/csshtmlheader.py @@ -56,7 +56,7 @@ class CSSHTMLHeaderTransformer(Transformer): self._regen_header() - def call(self, nb, resources): + def transform(self, nb, resources): """Fetch and add CSS to the resource dictionary Fetch CSS from IPython and Pygments to add at the beginning diff --git a/IPython/nbconvert/transformers/revealhelp.py b/IPython/nbconvert/transformers/revealhelp.py index e49dbdc..a07c64f 100755 --- a/IPython/nbconvert/transformers/revealhelp.py +++ b/IPython/nbconvert/transformers/revealhelp.py @@ -34,7 +34,7 @@ class RevealHelpTransformer(Transformer): help="""If you want to use the speaker notes set this to True.""") - def call(self, nb, resources): + def transform(self, nb, resources): """ Called once to 'transform' contents of the notebook. diff --git a/IPython/nbconvert/transformers/sphinx.py b/IPython/nbconvert/transformers/sphinx.py index 12f02d2..8badb80 100755 --- a/IPython/nbconvert/transformers/sphinx.py +++ b/IPython/nbconvert/transformers/sphinx.py @@ -109,7 +109,7 @@ class SphinxTransformer(Transformer): overridetitle = Unicode("", config=True, help="") - def call(self, nb, resources): + def transform(self, nb, resources): """ Sphinx transformation to apply on each notebook. diff --git a/docs/source/whatsnew/development.rst b/docs/source/whatsnew/development.rst index cf00639..c919fbb 100644 --- a/docs/source/whatsnew/development.rst +++ b/docs/source/whatsnew/development.rst @@ -10,3 +10,7 @@ Backwards incompatible changes * Python 2.6 and 3.2 are no longer supported: the minimum required Python versions are now 2.7 and 3.3. +* The `call` methods for nbconvert transformers has been renamed to + `transform`. +* The `call` methods of nbconvert post-processsors have been renamed to + `postprocess`.