Changing notebook uuid algorithm to preserver across sessions.

Brian E. Granger 15 years ago
parent b5b4cf260f
commit 6243652cfd

@ -220,6 +220,7 @@ class IPythonNotebookApp(BaseIPythonApplication):
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 @@ class NotebookManager(LoggingConfigurable):
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

Loading…
Cancel
Save