From 077a94c550330fde233407b61b98d72d8199bfe3 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 20 May 2009 20:05:14 +0000 Subject: [PATCH] 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 --- django/core/management/commands/makemessages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index c8c34735f2..f2b50532ad 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -1,6 +1,7 @@ import re import os import sys +import glob import warnings from itertools import dropwhile from optparse import make_option @@ -95,8 +96,9 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False, extens if locale is not None: languages.append(locale) 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: if verbosity > 0: print "processing language", locale