fixed notebook rename after nbmanager refactor

This commit is contained in:
Zachary Sailer 2013-08-28 14:04:13 -07:00 committed by MinRK
parent 14fd50f80b
commit 7aaaab0668
2 changed files with 4 additions and 4 deletions

View File

@ -241,7 +241,7 @@ class FileNotebookManager(NotebookManager):
# Should we proceed with the move?
if os.path.isfile(new_os_path):
raise web.HTTPError(409, u'Notebook with name already exists: ' % new_os_path)
raise web.HTTPError(409, u'Notebook with name already exists: %s' % new_os_path)
if self.save_script:
old_py_path = os.path.splitext(old_os_path)[0] + '.py'
new_py_path = os.path.splitext(new_os_path)[0] + '.py'
@ -258,8 +258,8 @@ class FileNotebookManager(NotebookManager):
old_checkpoints = self.list_checkpoints(old_name, old_path)
for cp in old_checkpoints:
checkpoint_id = cp['checkpoint_id']
old_cp_path = self.get_checkpoint_path(checkpoint_id, old_name, path)
new_cp_path = self.get_checkpoint_path(checkpoint_id, new_name, path)
old_cp_path = self.get_checkpoint_path(checkpoint_id, old_name, old_path)
new_cp_path = self.get_checkpoint_path(checkpoint_id, new_name, new_path)
if os.path.isfile(old_cp_path):
self.log.debug("Renaming checkpoint %s -> %s", old_cp_path, new_cp_path)
os.rename(old_cp_path, new_cp_path)

View File

@ -129,7 +129,7 @@ var IPython = (function (IPython) {
var nbname = IPython.notebook.notebook_name;
var path = IPython.notebook.notebookPath();
var state = {"path": path+nbname}
window.history.replaceState(state, "", "/notebooks/" + path+nbname);
window.history.replaceState(state, "", "/notebooks" + path+nbname);
}