makemessages: Exclude hidden files.

Fixes #3981.
This commit is contained in:
Umair Khan
2017-04-05 12:23:35 +05:00
committed by Tim Abbott
parent bccda3c76a
commit 846e8686c4

View File

@@ -162,6 +162,8 @@ class Command(makemessages.Command):
for dirpath, dirnames, filenames in os.walk(dirname):
for filename in [f for f in filenames if f.endswith(".handlebars")]:
if filename.startswith('.'):
continue
with open(os.path.join(dirpath, filename), 'r') as reader:
data = reader.read()
data = data.replace('\n', '\\n')
@@ -169,7 +171,7 @@ class Command(makemessages.Command):
dirname = os.path.join(settings.DEPLOY_ROOT, 'static/js')
for filename in os.listdir(dirname):
if filename.endswith('.js'):
if filename.endswith('.js') and not filename.startswith('.'):
with open(os.path.join(dirname, filename)) as reader:
data = reader.read()
translation_strings.update(self.extract_strings(data))