Skip to content

Commit

Permalink
More pythonic if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
sharky93 committed Apr 15, 2014
1 parent c089c62 commit bc7f3d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/ext/notebook.py
Expand Up @@ -159,7 +159,7 @@ def python_to_notebook(example_file, notebook_dir, notebook_path):
# If the text segment had only comments, then source is blank,
# So, ignore it, as already added in cell type markdown
if line == "\n":
if segment_has_begun is True and source:
if segment_has_begun and source:
# we've found text segments within the docstring
if docstring:
nb.add_cell(source, 'markdown')
Expand All @@ -171,7 +171,7 @@ def python_to_notebook(example_file, notebook_dir, notebook_path):
line = line.strip(' #')
nb.add_cell(line, 'markdown')
elif line == '"""\n':
if docstring is False:
if not docstring:
docstring = True
# Indicates, completion of docstring
# add whatever in source to markdown (cell type markdown)
Expand Down

0 comments on commit bc7f3d6

Please sign in to comment.