Skip to content

Commit

Permalink
Rename paired notebooks, even those that were not previously open
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Feb 26, 2019
1 parent 931053c commit fdc32ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ def trust_notebook(self, path):

def rename_file(self, old_path, new_path):
"""Rename the current notebook, as well as its alternative representations"""
if old_path not in self.paired_notebooks:
try:
# we do not know yet if this is a paired notebook (#190)
# -> to get this information we open the notebook
self.get(old_path, content=True)
except Exception:
pass

if old_path not in self.paired_notebooks:
super(TextFileContentsManager, self).rename_file(old_path, new_path)
return
Expand Down

0 comments on commit fdc32ea

Please sign in to comment.