(filename, pattern)
| 127 | # find files |
| 128 | |
| 129 | def match_glob(filename, pattern): |
| 130 | if fnmatch.fnmatch(filename, pattern): |
| 131 | return True |
| 132 | |
| 133 | # fnmatch doesn't handle ** quite right. It will not match the |
| 134 | # following: |
| 135 | # |
| 136 | # ('x/spam.py', 'x/**/*.py') |
| 137 | # ('spam.py', '**/*.py') |
| 138 | # |
| 139 | # though it *will* match the following: |
| 140 | # |
| 141 | # ('x/y/spam.py', 'x/**/*.py') |
| 142 | # ('x/spam.py', '**/*.py') |
| 143 | |
| 144 | if '**/' not in pattern: |
| 145 | return False |
| 146 | |
| 147 | # We only accommodate the single-"**" case. |
| 148 | return fnmatch.fnmatch(filename, pattern.replace('**/', '', 1)) |
| 149 | |
| 150 | |
| 151 | def process_filenames(filenames, *, |
no test coverage detected
searching dependent graphs…