Skip to content

broken links in the gallery #1024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions doc/sphinxext/gen_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os, glob, re, sys, warnings
import matplotlib.image as image

multiimage = re.compile('(.*)_\d\d')
multiimage = re.compile('(.*?)(_\d\d){1,2}')

def make_thumbnail(args):
image.thumbnail(args[0], args[1], 0.3)
Expand Down Expand Up @@ -68,11 +68,8 @@ def gen_gallery(app, doctree):
thumbnails[orig_path] = thumb_path

m = multiimage.match(basename)
if m is None:
pyfile = '%s.py'%basename
else:
if m is not None:
basename = m.group(1)
pyfile = '%s.py'%basename

data.append((subdir, basename,
os.path.join(rootdir, subdir, 'thumbnails', filename)))
Expand Down