From 2d590459a177a55920d1bc9c6489fa2006613008 2014-11-01 23:41:07 From: MinRK Date: 2014-11-01 23:41:07 Subject: [PATCH] remove heading cells in v4 --- diff --git a/IPython/html/nbconvert/tests/test_nbconvert_handlers.py b/IPython/html/nbconvert/tests/test_nbconvert_handlers.py index 0e3cec7..87ce4ba 100644 --- a/IPython/html/nbconvert/tests/test_nbconvert_handlers.py +++ b/IPython/html/nbconvert/tests/test_nbconvert_handlers.py @@ -11,7 +11,7 @@ import requests from IPython.html.utils import url_path_join from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error from IPython.nbformat.current import (new_notebook, write, - new_heading_cell, new_code_cell, + new_markdown_cell, new_code_cell, new_output) from IPython.testing.decorators import onlyif_cmds_exist @@ -55,7 +55,7 @@ class APITest(NotebookTestBase): nb = new_notebook() - nb.cells.append(new_heading_cell(u'Created by test ³')) + nb.cells.append(new_markdown_cell(u'Created by test ³')) cc1 = new_code_cell(source=u'print(2*6)') cc1.outputs.append(new_output(output_type="stream", text=u'12')) cc1.outputs.append(new_output(output_type="execute_result", diff --git a/IPython/html/services/contents/filemanager.py b/IPython/html/services/contents/filemanager.py index 8077de1..14ed305 100644 --- a/IPython/html/services/contents/filemanager.py +++ b/IPython/html/services/contents/filemanager.py @@ -255,7 +255,7 @@ class FileContentsManager(ContentsManager): try: nb = current.read(f, u'json') except Exception as e: - raise web.HTTPError(400, u"Unreadable Notebook: %s %s" % (os_path, e)) + raise web.HTTPError(400, u"Unreadable Notebook: %s %r" % (os_path, e)) self.mark_trusted_cells(nb, name, path) model['content'] = nb model['format'] = 'json' diff --git a/IPython/html/services/contents/tests/test_contents_api.py b/IPython/html/services/contents/tests/test_contents_api.py index bb5a175..0b704de 100644 --- a/IPython/html/services/contents/tests/test_contents_api.py +++ b/IPython/html/services/contents/tests/test_contents_api.py @@ -16,7 +16,7 @@ from IPython.html.utils import url_path_join, url_escape from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error from IPython.nbformat import current from IPython.nbformat.current import (new_notebook, write, read, - new_heading_cell, to_notebook_json) + new_markdown_cell, to_notebook_json) from IPython.nbformat import v2 from IPython.utils import py3compat from IPython.utils.data import uniq_stable @@ -415,7 +415,7 @@ class APITest(NotebookTestBase): resp = self.api.read('a.ipynb', 'foo') nbcontent = json.loads(resp.text)['content'] nb = to_notebook_json(nbcontent) - nb.cells.append(new_heading_cell(u'Created by test ³')) + nb.cells.append(new_markdown_cell(u'Created by test ³')) nbmodel= {'name': 'a.ipynb', 'path':'foo', 'content': nb, 'type': 'notebook'} resp = self.api.save('a.ipynb', path='foo', body=json.dumps(nbmodel)) @@ -452,7 +452,7 @@ class APITest(NotebookTestBase): # Modify it nbcontent = json.loads(resp.text)['content'] nb = to_notebook_json(nbcontent) - hcell = new_heading_cell('Created by test') + hcell = new_markdown_cell('Created by test') nb.cells.append(hcell) # Save nbmodel= {'name': 'a.ipynb', 'path':'foo', 'content': nb, 'type': 'notebook'} diff --git a/IPython/html/static/notebook/js/maintoolbar.js b/IPython/html/static/notebook/js/maintoolbar.js index 6bb0f1b..becca07 100644 --- a/IPython/html/static/notebook/js/maintoolbar.js +++ b/IPython/html/static/notebook/js/maintoolbar.js @@ -139,12 +139,6 @@ define([ .append($('