Permalink
Browse files

Notebook id removed from the notebook format.

  • Loading branch information...
1 parent fb55a88 commit a86896dd610250f2a895b16848954089ec2f6a36 @ellisonbg ellisonbg committed Aug 15, 2011
@@ -745,7 +745,6 @@ var IPython = (function (IPython) {
var data = this.toJSON();
data.name = nbname;
data.nbformat = 2;
- data.id = notebook_id
// We do the call with settings so we can set cache to false.
var settings = {
processData : false,
@@ -107,17 +107,13 @@ def new_worksheet(name=None, cells=None):
return ws
-def new_notebook(name=None, id=None, worksheets=None, author=None, email=None,
+def new_notebook(name=None, worksheets=None, author=None, email=None,
created=None, saved=None, license=None):
"""Create a notebook by name, id and a list of worksheets."""
nb = NotebookNode()
nb.nbformat = 2
if name is not None:
nb.name = unicode(name)
- if id is None:
- nb.id = unicode(uuid.uuid4())
- else:
- nb.id = unicode(id)
if worksheets is None:
nb.worksheets = []
else:
@@ -91,7 +91,6 @@ def reads(self, s, **kwargs):
def to_notebook(self, root, **kwargs):
nbname = _get_text(root,u'name')
- nbid = _get_text(root,u'id')
nbauthor = _get_text(root,u'author')
nbemail = _get_text(root,u'email')
nblicense = _get_text(root,u'license')
@@ -152,7 +151,7 @@ def to_notebook(self, root, **kwargs):
ws = new_worksheet(name=wsname,cells=cells)
worksheets.append(ws)
- nb = new_notebook(name=nbname,id=nbid,worksheets=worksheets,author=nbauthor,
+ nb = new_notebook(name=nbname,worksheets=worksheets,author=nbauthor,
email=nbemail,license=nblicense,saved=nbsaved,created=nbcreated)
return nb
@@ -162,7 +161,6 @@ class XMLWriter(NotebookWriter):
def writes(self, nb, **kwargs):
nb_e = ET.Element(u'notebook')
_set_text(nb,u'name',nb_e,u'name')
- _set_text(nb,u'id',nb_e,u'id')
_set_text(nb,u'author',nb_e,u'author')
_set_text(nb,u'email',nb_e,u'email')
_set_text(nb,u'license',nb_e,u'license')
@@ -76,7 +76,6 @@ class TestNotebook(TestCase):
def test_empty_notebook(self):
nb = new_notebook()
- self.assertEquals('id' in nb, True)
self.assertEquals(nb.worksheets, [])
self.assertEquals('name' not in nb, True)
self.assertEquals(nb.nbformat,2)

0 comments on commit a86896d

Please sign in to comment.