1
0
mirror of https://github.com/django/django.git synced 2024-12-25 10:35:48 +00:00

Fixed #10867: make the makemessages command ignore files and only process directories. Thanks, diegobz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2009-05-20 20:05:14 +00:00
parent c935d7ffe3
commit 077a94c550

View File

@ -1,6 +1,7 @@
import re import re
import os import os
import sys import sys
import glob
import warnings import warnings
from itertools import dropwhile from itertools import dropwhile
from optparse import make_option from optparse import make_option
@ -95,7 +96,8 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False, extens
if locale is not None: if locale is not None:
languages.append(locale) languages.append(locale)
elif all: elif all:
languages = [el for el in os.listdir(localedir) if not el.startswith('.')] locale_dirs = filter(os.path.isdir, glob.glob('%s/*' % localedir))
languages = [os.path.basename(l) for l in locale_dirs]
for locale in languages: for locale in languages:
if verbosity > 0: if verbosity > 0: