diff options
| author | Ramiro Morales <ramiro@users.noreply.github.com> | 2014-08-18 13:33:02 -0300 |
|---|---|---|
| committer | Ramiro Morales <ramiro@users.noreply.github.com> | 2014-08-18 13:33:02 -0300 |
| commit | 152afadef12e3dcb9ce92567d2e58269749d63b9 (patch) | |
| tree | efd84e01fa422858cbcd44db30285ddb3874c661 | |
| parent | e0a98e2374b1d7660ef3841a5bb2626f1c69970a (diff) | |
| parent | b4dce7c37ab7666b023ac791d2c46dad6c8aa637 (diff) | |
Merge pull request #3075 from ramiro/makemessages-ignore-windows
Fixed #23298 -- Made makemessages actually ignore specified dirs on Wind...
| -rw-r--r-- | django/core/management/commands/makemessages.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 335cfab238..0b0d200094 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -364,8 +364,17 @@ class Command(BaseCommand): fnmatch.fnmatchcase(path, pattern)) return any(ignore(pattern) for pattern in ignore_patterns) - dir_suffix = '%s*' % os.sep - norm_patterns = [p[:-len(dir_suffix)] if p.endswith(dir_suffix) else p for p in self.ignore_patterns] + ignore_patterns = [os.path.normcase(p) for p in self.ignore_patterns] + dir_suffixes = {'%s*' % path_sep for path_sep in {'/', os.sep}} + norm_patterns = [] + for p in ignore_patterns: + for dir_suffix in dir_suffixes: + if p.endswith(dir_suffix): + norm_patterns.append(p[:-len(dir_suffix)]) + break + else: + norm_patterns.append(p) + all_files = [] for dirpath, dirnames, filenames in os.walk(root, topdown=True, followlinks=self.symlinks): for dirname in dirnames[:]: |
