diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 77e7e62..b720ef3 100644
a
|
b
|
class TranslatableFile(object):
|
62 | 62 | if command.verbosity > 1: |
63 | 63 | command.stdout.write('processing file %s in %s\n' % (self.file, self.dirpath)) |
64 | 64 | _, file_ext = os.path.splitext(self.file) |
65 | | if domain == 'djangojs' and file_ext in command.extensions: |
| 65 | if domain == 'djangojs': |
66 | 66 | orig_file = os.path.join(self.dirpath, self.file) |
67 | 67 | work_file = orig_file |
68 | 68 | is_templatized = command.gettext_version < (0, 18, 3) |
… |
… |
class TranslatableFile(object):
|
85 | 85 | '--output=-' |
86 | 86 | ] + command.xgettext_options |
87 | 87 | args.append(work_file) |
88 | | elif domain == 'django' and (file_ext == '.py' or file_ext in command.extensions): |
| 88 | elif domain == 'django': |
89 | 89 | orig_file = os.path.join(self.dirpath, self.file) |
90 | 90 | work_file = orig_file |
91 | | is_templatized = file_ext in command.extensions |
| 91 | is_templatized = file_ext != '.py' |
92 | 92 | if is_templatized: |
93 | 93 | with io.open(orig_file, encoding=settings.FILE_CHARSET) as fp: |
94 | 94 | src_data = fp.read() |
… |
… |
class Command(BaseCommand):
|
250 | 250 | if self.domain == 'djangojs': |
251 | 251 | exts = extensions if extensions else ['js'] |
252 | 252 | else: |
253 | | exts = extensions if extensions else ['html', 'txt'] |
254 | | self.extensions = handle_extensions(exts) |
| 253 | exts = extensions if extensions else ['html', 'txt', 'py'] |
| 254 | self.extensions = handle_extensions(exts, ignored=()) |
255 | 255 | |
256 | 256 | if (locale is None and not exclude and not process_all) or self.domain is None: |
257 | 257 | raise CommandError("Type '%s help %s' for usage information." % ( |
… |
… |
class Command(BaseCommand):
|
394 | 394 | self.locale_paths.insert(0, os.path.join(os.path.abspath(dirpath), dirname)) |
395 | 395 | for filename in filenames: |
396 | 396 | file_path = os.path.normpath(os.path.join(dirpath, filename)) |
397 | | if is_ignored(file_path, self.ignore_patterns): |
| 397 | _, file_ext = os.path.splitext(filename) |
| 398 | if not (file_ext in self.extensions) or \ |
| 399 | is_ignored(file_path, self.ignore_patterns): |
398 | 400 | if self.verbosity > 1: |
399 | 401 | self.stdout.write('ignoring file %s in %s\n' % (filename, dirpath)) |
400 | 402 | else: |