From eacecbe9e36fe41205061ab59d055c17849468c1 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Fri, 21 Jan 2011 21:00:39 +0000 Subject: [PATCH] Converted makemessages management command to a NoArgsCommand. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15279 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/makemessages.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 1b311643554..7c317217522 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -7,7 +7,7 @@ from itertools import dropwhile from optparse import make_option from subprocess import PIPE, Popen -from django.core.management.base import CommandError, BaseCommand +from django.core.management.base import CommandError, NoArgsCommand from django.utils.text import get_text_list pythonize_re = re.compile(r'(?:^|\n)\s*//') @@ -298,8 +298,8 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False, raise CommandError("errors happened while running msgattrib\n%s" % errors) -class Command(BaseCommand): - option_list = BaseCommand.option_list + ( +class Command(NoArgsCommand): + option_list = NoArgsCommand.option_list + ( make_option('--locale', '-l', default=None, dest='locale', help='Creates or updates the message files only for the given locale (e.g. pt_BR).'), make_option('--domain', '-d', default='django', dest='domain', @@ -325,10 +325,7 @@ class Command(BaseCommand): requires_model_validation = False can_import_settings = False - def handle(self, *args, **options): - if len(args) != 0: - raise CommandError("Command doesn't accept any arguments") - + def handle_noargs(self, *args, **options): locale = options.get('locale') domain = options.get('domain') verbosity = int(options.get('verbosity'))