|
@@ -30,7 +30,6 @@ class CommandError(Exception):
|
|
|
result, raising this exception (with a sensible description of the
|
|
|
error) is the preferred way to indicate that something has gone
|
|
|
wrong in the execution of a command.
|
|
|
-
|
|
|
"""
|
|
|
pass
|
|
|
|
|
@@ -71,7 +70,6 @@ def handle_default_options(options):
|
|
|
Include any default options that all commands should accept here
|
|
|
so that ManagementUtility can handle them before searching for
|
|
|
user commands.
|
|
|
-
|
|
|
"""
|
|
|
if options.settings:
|
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = options.settings
|
|
@@ -237,7 +235,6 @@ class BaseCommand(object):
|
|
|
Return the Django version, which should be correct for all
|
|
|
built-in Django commands. User-supplied commands should
|
|
|
override this method.
|
|
|
-
|
|
|
"""
|
|
|
return django.get_version()
|
|
|
|
|
@@ -245,7 +242,6 @@ class BaseCommand(object):
|
|
|
"""
|
|
|
Return a brief description of how to use this command, by
|
|
|
default from the attribute ``self.help``.
|
|
|
-
|
|
|
"""
|
|
|
usage = '%%prog %s [options] %s' % (subcommand, self.args)
|
|
|
if self.help:
|
|
@@ -257,7 +253,6 @@ class BaseCommand(object):
|
|
|
"""
|
|
|
Create and return the ``ArgumentParser`` which will be used to
|
|
|
parse the arguments to this command.
|
|
|
-
|
|
|
"""
|
|
|
if not self.use_argparse:
|
|
|
def store_as_int(option, opt_str, value, parser):
|
|
@@ -324,7 +319,6 @@ class BaseCommand(object):
|
|
|
"""
|
|
|
Print the help message for this command, derived from
|
|
|
``self.usage()``.
|
|
|
-
|
|
|
"""
|
|
|
parser = self.create_parser(prog_name, subcommand)
|
|
|
parser.print_help()
|
|
@@ -488,7 +482,6 @@ class BaseCommand(object):
|
|
|
"""
|
|
|
The actual logic of the command. Subclasses must implement
|
|
|
this method.
|
|
|
-
|
|
|
"""
|
|
|
raise NotImplementedError('subclasses of BaseCommand must provide a handle() method')
|
|
|
|
|
@@ -541,7 +534,6 @@ class LabelCommand(BaseCommand):
|
|
|
|
|
|
If the arguments should be names of installed applications, use
|
|
|
``AppCommand`` instead.
|
|
|
-
|
|
|
"""
|
|
|
label = 'label'
|
|
|
missing_args_message = "Enter at least one %s." % label
|
|
@@ -561,7 +553,6 @@ class LabelCommand(BaseCommand):
|
|
|
"""
|
|
|
Perform the command's actions for ``label``, which will be the
|
|
|
string as given on the command line.
|
|
|
-
|
|
|
"""
|
|
|
raise NotImplementedError('subclasses of LabelCommand must provide a handle_label() method')
|
|
|
|
|
@@ -575,7 +566,6 @@ class NoArgsCommand(BaseCommand):
|
|
|
no arguments are passed to the command.
|
|
|
|
|
|
Attempting to pass arguments will raise ``CommandError``.
|
|
|
-
|
|
|
"""
|
|
|
args = ''
|
|
|
|
|
@@ -595,6 +585,5 @@ class NoArgsCommand(BaseCommand):
|
|
|
def handle_noargs(self, **options):
|
|
|
"""
|
|
|
Perform this command's actions.
|
|
|
-
|
|
|
"""
|
|
|
raise NotImplementedError('subclasses of NoArgsCommand must provide a handle_noargs() method')
|