diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 95c1da0..07e5439 100644
a
|
b
|
def _popen(cmd):
|
44 | 44 | p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 'nt', universal_newlines=True) |
45 | 45 | return p.communicate() |
46 | 46 | |
47 | | def walk(root, topdown=True, onerror=None, followlinks=False): |
| 47 | def walk(root, topdown=True, onerror=None, followlinks=False, ignore_patterns=[], verbosity=0): |
48 | 48 | """ |
49 | 49 | A version of os.walk that can follow symlinks for Python < 2.6 |
50 | 50 | """ |
51 | 51 | for dirpath, dirnames, filenames in os.walk(root, topdown, onerror): |
| 52 | remove_dirs = [] |
| 53 | for dirname in dirnames: |
| 54 | if is_ignored(os.path.normpath(os.path.join(dirpath, dirname)), ignore_patterns): |
| 55 | remove_dirs.append(dirname) |
| 56 | for dirname in remove_dirs: |
| 57 | dirnames.remove(dirname) |
| 58 | if verbosity > 1: |
| 59 | sys.stdout.write('ignoring directory %s\n' % dirname) |
52 | 60 | yield (dirpath, dirnames, filenames) |
53 | 61 | if followlinks: |
54 | 62 | for d in dirnames: |
… |
… |
def find_files(root, ignore_patterns, verbosity, symlinks=False):
|
71 | 79 | Helper function to get all files in the given root. |
72 | 80 | """ |
73 | 81 | all_files = [] |
74 | | for (dirpath, dirnames, filenames) in walk(".", followlinks=symlinks): |
| 82 | for (dirpath, dirnames, filenames) in walk(".", followlinks=symlinks, |
| 83 | ignore_patterns=ignore_patterns, verbosity=verbosity): |
75 | 84 | for f in filenames: |
76 | 85 | norm_filepath = os.path.normpath(os.path.join(dirpath, f)) |
77 | 86 | if is_ignored(norm_filepath, ignore_patterns): |