~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to tests/modeltests/user_commands/management/commands/dance.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2013-11-07 15:33:49 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131107153349-e31sc149l2szs3jb
Tags: 1.6-1
* New upstream version. Closes: #557474, #724637.
* python-django now also suggests the installation of ipython,
  bpython, python-django-doc, and libgdal1.
  Closes: #636511, #686333, #704203
* Set package maintainer to Debian Python Modules Team.
* Bump standards version to 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from optparse import make_option
2
 
 
3
 
from django.core.management.base import BaseCommand, CommandError
4
 
 
5
 
 
6
 
class Command(BaseCommand):
7
 
    help = "Dance around like a madman."
8
 
    args = ''
9
 
    requires_model_validation = True
10
 
 
11
 
    option_list = BaseCommand.option_list + (
12
 
        make_option("-s", "--style", default="Rock'n'Roll"),
13
 
        make_option("-x", "--example")
14
 
    )
15
 
 
16
 
    def handle(self, *args, **options):
17
 
        example = options["example"]
18
 
        if example == "raise":
19
 
            raise CommandError()
20
 
        self.stdout.write("I don't feel like dancing %s." % options["style"])