##// END OF EJS Templates
Changing notebook uuid algorithm to preserver across sessions.
Brian E. Granger -
Show More
@@ -220,6 +220,7 b' class IPythonNotebookApp(BaseIPythonApplication):'
220 config=self.config, log=self.log, kernel_argv=self.kernel_argv
220 config=self.config, log=self.log, kernel_argv=self.kernel_argv
221 )
221 )
222 self.notebook_manager = NotebookManager(config=self.config, log=self.log)
222 self.notebook_manager = NotebookManager(config=self.config, log=self.log)
223 self.notebook_manager.list_notebooks()
223
224
224 def init_logging(self):
225 def init_logging(self):
225 super(IPythonNotebookApp, self).init_logging()
226 super(IPythonNotebookApp, self).init_logging()
@@ -67,7 +67,8 b' class NotebookManager(LoggingConfigurable):'
67
67
68 def new_notebook_id(self, name):
68 def new_notebook_id(self, name):
69 """Generate a new notebook_id for a name and store its mappings."""
69 """Generate a new notebook_id for a name and store its mappings."""
70 notebook_id = unicode(uuid.uuid4())
70 notebook_id = unicode(uuid.uuid5(uuid.NAMESPACE_URL,
71 'file://'+self.get_path_by_name(name).encode('utf-8')))
71 self.mapping[notebook_id] = name
72 self.mapping[notebook_id] = name
72 self.rev_mapping[name] = notebook_id
73 self.rev_mapping[name] = notebook_id
73 return notebook_id
74 return notebook_id
General Comments 0
You need to be logged in to leave comments. Login now