From a53f880256b1189ed28df38a094a2e2c54d30225 Mon Sep 17 00:00:00 2001 From: Rishabh Raj Date: Sun, 13 Apr 2014 12:51:45 +0530 Subject: [PATCH] Fix typo, better function name and docstring summary --- doc/ext/notebook.py | 8 ++++---- doc/ext/plot2rst.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/ext/notebook.py b/doc/ext/notebook.py index 74cf881d..ab67f72b 100644 --- a/doc/ext/notebook.py +++ b/doc/ext/notebook.py @@ -38,7 +38,7 @@ class Notebook(): # Adds an extra newline at the end, which aids in extraction of text segments self.code.append('\n') - def filter_continous_duplication(self): + def filter_continuous_duplication(self): """ Clusters multiple '\n's into one. For ex - 'import xyz\n\n\n print 2' becomes 'import xyz\n print 2' """ modified_code = [] @@ -57,8 +57,8 @@ class Notebook(): json.dump(self.template, output, indent=2) -def save_ipython_notebook(example_file, notebook_dir, notebook_path): - """ Saves a Python file as an IPython notebook +def python_to_notebook(example_file, notebook_dir, notebook_path): + """ Convert a Python file to an IPython notebook. Parameters ---------- @@ -78,7 +78,7 @@ def save_ipython_notebook(example_file, notebook_dir, notebook_path): docstring = False source = [] - modified_code = nb.filter_continous_duplication() + modified_code = nb.filter_continuous_duplication() for line in modified_code: # A linebreak indicates a segment has ended. If the text segment had only comments, then source is blank, diff --git a/doc/ext/plot2rst.py b/doc/ext/plot2rst.py index 7de4f589..6131c50e 100644 --- a/doc/ext/plot2rst.py +++ b/doc/ext/plot2rst.py @@ -374,7 +374,7 @@ def write_example(src_name, src_dir, rst_dir, cfg): else: shutil.copy(cfg.plot2rst_default_thumb, thumb_path) - save_ipython_notebook(example_file, notebook_dir, notebook_path) + python_to_notebook(example_file, notebook_dir, notebook_path) def save_thumbnail(image, thumb_path, shape):