Fix typo, better function name and docstring summary

This commit is contained in:
Rishabh Raj
2014-04-13 12:51:45 +05:30
parent 0c9ee09f04
commit a53f880256
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -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,
+1 -1
View File
@@ -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):