Skip to content
This repository

Allow usage of '.' in notebook names #709

Merged
merged 2 commits into from over 2 years ago

3 participants

Stefan van der Walt Min RK Brian E. Granger
Stefan van der Walt

No description provided.

Stefan van der Walt

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.

Min RK
Owner

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

Brian E. Granger ellisonbg merged commit 0e2ee7f into from August 18, 2011
Brian E. Granger ellisonbg closed this August 18, 2011
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.
9  IPython/frontend/html/notebook/notebookmanager.py
@@ -19,6 +19,7 @@
19 19
 import datetime
20 20
 import os
21 21
 import uuid
  22
+import glob
22 23
 
23 24
 from tornado import web
24 25
 
@@ -52,9 +53,11 @@ def list_notebooks(self):
52 53
 
53 54
             dict(notebook_id=notebook,name=name)
54 55
         """
55  
-        names = os.listdir(self.notebook_dir)
56  
-        names = [name.split(u'.')[0]
57  
-            for name in names if name.endswith(self.filename_ext)]
  56
+        names = glob.glob(os.path.join(self.notebook_dir,
  57
+                                       '*' + self.filename_ext))
  58
+        names = [os.path.splitext(os.path.basename(name))[0]
  59
+                 for name in names]
  60
+
58 61
         data = []
59 62
         for name in names:
60 63
             if name not in self.rev_mapping:
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.