Skip to content

Commit

Permalink
FIX: Fix search pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored and lesteve committed Feb 19, 2018
1 parent 7ef12da commit e48d2fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions sphinx_gallery/gen_rst.py
Expand Up @@ -434,9 +434,11 @@ def generate_dir_rst(src_dir, target_dir, gallery_conf, seen_backrefs):
# get filenames
listdir = [fname for fname in os.listdir(src_dir)
if fname.endswith('.py')]
# limit which to look at based on regex
# limit which to look at based on regex (similar to filename_pattern)
listdir = [fname for fname in listdir
if re.match(gallery_conf['ignore_pattern'], fname) is None]
if re.search(gallery_conf['ignore_pattern'],
os.path.normpath(os.path.join(src_dir, fname)))
is None]
# sort them
sorted_listdir = sorted(
listdir, key=gallery_conf['within_subsection_order'](src_dir))
Expand Down
3 changes: 2 additions & 1 deletion sphinx_gallery/tests/tinybuild/examples/__init__.py
@@ -1 +1,2 @@
from numpy import pad
# This file is ignored through ignore_pattern so it does not need to have a
# docstring following the sphinx-gallery convention (i.e. title + description)

0 comments on commit e48d2fe

Please sign in to comment.