##// END OF EJS Templates
Better use Python slicing
Thomas Kluyver -
Show More
@@ -44,19 +44,18 b' class NotebookManager(LoggingConfigurable):'
44 44
45 45 def named_notebook_path(self, notebook_path):
46 46
47 l = len(notebook_path)
48 47 names = notebook_path.split('/')
49 48 if len(names) > 1:
50 name = names[len(names)-1]
51 if name[(len(name)-6):(len(name))] == ".ipynb":
49 name = names[-1]
50 if name.endswith(".ipynb"):
52 51 name = name
53 path = notebook_path[0:l-len(name)-1]+'/'
52 path = notebook_path[0:-len(name)-1]+'/'
54 53 else:
55 54 name = None
56 55 path = notebook_path+'/'
57 56 else:
58 57 name = names[0]
59 if name[(len(name)-6):(len(name))] == ".ipynb":
58 if name.endswith(".ipynb"):
60 59 name = name
61 60 path = None
62 61 else:
General Comments 0
You need to be logged in to leave comments. Login now