Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow usage of '.' in notebook names #709

Merged
merged 2 commits into from

3 participants

@stefanv

No description provided.

@stefanv

Note that, while 'glob.glob(pattern)' would already grab all the files in the notebook directory, I chose to write it this way so that it will be easy to change the notebook server directory later on.

@minrk
Owner

Nice! Other than putting the glob import module-level as seems to be our practice, this seems quite sensible and ready for merge.

@ellisonbg ellisonbg merged commit 0e2ee7f into ipython:htmlnotebook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 IPython/frontend/html/notebook/notebookmanager.py
View
9 IPython/frontend/html/notebook/notebookmanager.py
@@ -19,6 +19,7 @@
import datetime
import os
import uuid
+import glob
from tornado import web
@@ -52,9 +53,11 @@ def list_notebooks(self):
dict(notebook_id=notebook,name=name)
"""
- names = os.listdir(self.notebook_dir)
- names = [name.split(u'.')[0]
- for name in names if name.endswith(self.filename_ext)]
+ names = glob.glob(os.path.join(self.notebook_dir,
+ '*' + self.filename_ext))
+ names = [os.path.splitext(os.path.basename(name))[0]
+ for name in names]
+
data = []
for name in names:
if name not in self.rev_mapping:
Something went wrong with that request. Please try again.