Permalink
Browse files

Changing notebook uuid algorithm to preserver across sessions.

  • Loading branch information...
1 parent 7777bdd commit f4c83729df5ec7c725bf9d5f89d94274ed9bd4a8 @ellisonbg ellisonbg committed Aug 19, 2011
@@ -220,6 +220,7 @@ def init_configurables(self):
config=self.config, log=self.log, kernel_argv=self.kernel_argv
)
self.notebook_manager = NotebookManager(config=self.config, log=self.log)
+ self.notebook_manager.list_notebooks()
def init_logging(self):
super(IPythonNotebookApp, self).init_logging()
@@ -67,7 +67,8 @@ def list_notebooks(self):
def new_notebook_id(self, name):
"""Generate a new notebook_id for a name and store its mappings."""
- notebook_id = unicode(uuid.uuid4())
+ notebook_id = unicode(uuid.uuid5(uuid.NAMESPACE_URL,
+ 'file://'+self.get_path_by_name(name).encode('utf-8')))
self.mapping[notebook_id] = name
self.rev_mapping[name] = notebook_id
return notebook_id

0 comments on commit f4c8372

Please sign in to comment.