Browse files

Merge pull request #1024 from mdboom/fix-gallery

broken links in the gallery
  • Loading branch information...
2 parents 8089e04 + 64e64f6 commit ff883a60d0bc3473917373e47ff3ee5f64b0876b @mdboom mdboom committed Aug 3, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 doc/sphinxext/gen_gallery.py
View
7 doc/sphinxext/gen_gallery.py
@@ -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)
@@ -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)))

0 comments on commit ff883a6

Please sign in to comment.