mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-13 13:17:50 +08:00
fixed notebook rename after nbmanager refactor
This commit is contained in:
parent
14fd50f80b
commit
7aaaab0668
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user