Show More
@@ -43,13 +43,27 b' class NotebookManager(LoggingConfigurable):' | |||
|
43 | 43 | """) |
|
44 | 44 | |
|
45 | 45 | def named_notebook_path(self, notebook_path): |
|
46 | ||
|
46 | """Given a notebook_path name, returns a (name, path) tuple, where | |
|
47 | name is a .ipynb file, and path is the directory for the file. | |
|
48 | ||
|
49 | Parameters | |
|
50 | ---------- | |
|
51 | notebook_path : string | |
|
52 | A path that may be a .ipynb name or a directory | |
|
53 | ||
|
54 | Returns | |
|
55 | ------- | |
|
56 | name : string or None | |
|
57 | the filename of the notebook, or None if not a .ipynb extesnsion | |
|
58 | path : string or None | |
|
59 | the path to the directory which contains the notebook | |
|
60 | """ | |
|
47 | 61 | names = notebook_path.split('/') |
|
48 | 62 |
if len(names) > 1: |
|
49 | 63 | name = names[-1] |
|
50 | 64 | if name.endswith(".ipynb"): |
|
51 | 65 | name = name |
|
52 |
path = notebook_path[ |
|
|
66 | path = notebook_path[:-1]+'/' | |
|
53 | 67 | else: |
|
54 | 68 | name = None |
|
55 | 69 | path = notebook_path+'/' |
General Comments 0
You need to be logged in to leave comments.
Login now