Skip to content

Commit

Permalink
Merge pull request #155 from gsnedders/glob_paths
Browse files Browse the repository at this point in the history
Use glob on include/exclude paths
  • Loading branch information
jgraham committed Nov 6, 2015
2 parents d1d81bd + 1b2f9e6 commit de53aee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wptrunner/manifestinclude.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
representing the file and each subnode representing a subdirectory that should
be included or excluded.
"""
import glob
import os
import urlparse

Expand Down Expand Up @@ -91,9 +92,9 @@ def _add_rule(self, test_manifests, url, direction):

maybe_path = os.path.join(rest, last)

if os.path.exists(maybe_path):
for path in glob.iglob(maybe_path):
for manifest, data in test_manifests.iteritems():
rel_path = os.path.relpath(maybe_path, data["tests_path"])
rel_path = os.path.relpath(path, data["tests_path"])
if ".." not in rel_path.split(os.sep):
url = data["url_base"] + rel_path.replace(os.path.sep, "/") + variant
break
Expand Down

0 comments on commit de53aee

Please sign in to comment.