Recursively walk the storage directories yielding the paths of all files that should be copied.
(storage, ignore_patterns=None, location="")
| 14 | |
| 15 | |
| 16 | def get_files(storage, ignore_patterns=None, location=""): |
| 17 | """ |
| 18 | Recursively walk the storage directories yielding the paths |
| 19 | of all files that should be copied. |
| 20 | """ |
| 21 | if ignore_patterns is None: |
| 22 | ignore_patterns = [] |
| 23 | directories, files = storage.listdir(location) |
| 24 | for fn in files: |
| 25 | # Match only the basename. |
| 26 | if matches_patterns(fn, ignore_patterns): |
| 27 | continue |
| 28 | if location: |
| 29 | fn = os.path.join(location, fn) |
| 30 | # Match the full file path. |
| 31 | if matches_patterns(fn, ignore_patterns): |
| 32 | continue |
| 33 | yield fn |
| 34 | for dir in directories: |
| 35 | if matches_patterns(dir, ignore_patterns): |
| 36 | continue |
| 37 | if location: |
| 38 | dir = os.path.join(location, dir) |
| 39 | yield from get_files(storage, ignore_patterns, dir) |
| 40 | |
| 41 | |
| 42 | def check_settings(base_url=None): |
nothing calls this directly
no test coverage detected