From e104c687aa0dc70358bef75fca3db68d9e5b6bf2 Mon Sep 17 00:00:00 2001 From: Rishabh Raj Date: Mon, 14 Apr 2014 04:28:25 +0530 Subject: [PATCH] More pythonic --- doc/ext/notebook.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ext/notebook.py b/doc/ext/notebook.py index 8d44b187..b3123a51 100644 --- a/doc/ext/notebook.py +++ b/doc/ext/notebook.py @@ -162,7 +162,7 @@ def python_to_notebook(example_file, notebook_dir, notebook_path): if segment_has_begun is True and source: segment_number += 1 # we've found text segments within the docstring - if docstring is True: + if docstring: nb.add_cell(segment_number, source, 'markdown') else: nb.add_cell(segment_number, source, 'code') @@ -175,9 +175,9 @@ def python_to_notebook(example_file, notebook_dir, notebook_path): elif line == '"""\n': if docstring is False: docstring = True - # Indicates, completion of docstring, + # Indicates, completion of docstring # add whatever in source to markdown (cell type markdown) - elif docstring is True: + elif docstring: docstring = False # Write leftover docstring if any left if source: