Normalize the excluded directory list: * must be either an absolute path or start with rootpath, * otherwise it is joined with rootpath * with trailing slash
(rootpath, excludes)
| 161 | |
| 162 | |
| 163 | def normalize_excludes(rootpath, excludes): |
| 164 | """ |
| 165 | Normalize the excluded directory list: |
| 166 | * must be either an absolute path or start with rootpath, |
| 167 | * otherwise it is joined with rootpath |
| 168 | * with trailing slash |
| 169 | """ |
| 170 | f_excludes = [] |
| 171 | for exclude in excludes: |
| 172 | if not path.isabs(exclude) and not exclude.startswith(rootpath): |
| 173 | exclude = path.join(rootpath, exclude) |
| 174 | f_excludes.append(path.normpath(exclude) + path.sep) |
| 175 | return f_excludes |
| 176 | |
| 177 | |
| 178 | def is_excluded(root, excludes): |