Skip to content

Commit

Permalink
Allow period characters in notebook names.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Aug 19, 2011
1 parent 7777bdd commit a2b246f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions IPython/frontend/html/notebook/notebookmanager.py
Expand Up @@ -52,9 +52,13 @@ 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)]
import glob

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:
Expand Down

1 comment on commit a2b246f

@stefanv
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Please sign in to comment.