Skip to content

Commit

Permalink
Add cells to traitlets to avoid ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
mpacer committed Mar 29, 2017
1 parent 8ec649a commit f99f668
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nbconvert/exporters/templateexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _template_file_default(self):
help = "This allows you to exclude output prompts from all templates if set to True."
).tag(config=True)

exclude_code = Bool(False,
exclude_code_cell = Bool(False,
help = "This allows you to exclude code cells from all templates if set to True."
).tag(config=True)

Expand Down Expand Up @@ -268,7 +268,7 @@ def from_notebook_node(self, nb, resources=None, **kw):
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
resources.setdefault('raw_mimetypes', self.raw_mimetypes)
resources['global_content_filter'] = {
'include_code': not self.exclude_code,
'include_code': not self.exclude_code_cell,
'include_markdown': not self.exclude_markdown,
'include_raw': not self.exclude_raw,
'include_unknown': not self.exclude_unknown,
Expand Down
12 changes: 6 additions & 6 deletions nbconvert/exporters/tests/test_templateexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ def test_fail_to_find_template_file(self):
with pytest.raises(TemplateNotFound):
out, resources = exporter.from_notebook_node(nb)

def test_exclude_codecells(self):
def test_exclude_code_cell(self):
no_io = {
"TemplateExporter":{
"exclude_output": True,
"exclude_input": True,
"exclude_input_prompt": False,
"exclude_output_prompt": False,
"exclude_markdown": False,
"exclude_code": False,
"exclude_code_cell": False,
}
}
c_no_io = Config(no_io)
Expand All @@ -172,7 +172,7 @@ def test_exclude_codecells(self):
"exclude_input_prompt": False,
"exclude_output_prompt": False,
"exclude_markdown": False,
"exclude_code": True,
"exclude_code_cell": True,
}
}
c_no_code = Config(no_code)
Expand All @@ -192,7 +192,7 @@ def test_exclude_input_prompt(self):
"exclude_input_prompt": True,
"exclude_output_prompt": False,
"exclude_markdown": False,
"exclude_code": False,
"exclude_code_cell": False,
}
}
c_no_input_prompt = Config(no_input_prompt)
Expand All @@ -211,7 +211,7 @@ def test_exclude_markdown(self):
"exclude_input_prompt": False,
"exclude_output_prompt": False,
"exclude_markdown": True,
"exclude_code": False,
"exclude_code_cell": False,
}
}

Expand All @@ -231,7 +231,7 @@ def test_exclude_output_prompt(self):
"exclude_input_prompt": False,
"exclude_output_prompt": True,
"exclude_markdown": False,
"exclude_code": False,
"exclude_code_cell": False,
}
}
c_no_output_prompt = Config(no_output_prompt)
Expand Down

0 comments on commit f99f668

Please sign in to comment.