1809.1.1
by jtv at canonical
Update copyright dates on template files. Annual chore. |
1 |
# Copyright 2014 Canonical Ltd. This software is licensed under the
|
750.1.1
by Jeroen Vermeulen
Template for custom maas commands. |
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
3 |
||
757.1.1
by Jeroen Vermeulen
Use TODO markers in templates. |
4 |
# TODO: Document purpose.
|
750.1.1
by Jeroen Vermeulen
Template for custom maas commands. |
5 |
"""Django command: """
|
6 |
||
7 |
from __future__ import ( |
|
8 |
absolute_import, |
|
9 |
print_function, |
|
10 |
unicode_literals, |
|
11 |
)
|
|
12 |
||
1640.1.9
by Gavin Panella
Alias str to None instead of unicode. |
13 |
str = None |
1640.1.1
by Gavin Panella
Alias str to unicode everywhere. |
14 |
|
750.1.1
by Jeroen Vermeulen
Template for custom maas commands. |
15 |
__metaclass__ = type |
16 |
__all__ = [ |
|
17 |
'Command', |
|
18 |
]
|
|
19 |
||
20 |
from optparse import make_option |
|
21 |
||
22 |
from django.core.management.base import BaseCommand |
|
23 |
||
24 |
||
25 |
class Command(BaseCommand): |
|
26 |
||
27 |
option_list = BaseCommand.option_list + ( |
|
757.1.1
by Jeroen Vermeulen
Use TODO markers in templates. |
28 |
# TODO: Define actual options.
|
750.1.2
by Jeroen Vermeulen
Cosmetic. |
29 |
make_option( |
30 |
'--option', dest='option', default=None, |
|
31 |
help="Describe option."), |
|
1640.2.9
by Gavin Panella
Fix gobs more lint. |
32 |
)
|
757.1.1
by Jeroen Vermeulen
Use TODO markers in templates. |
33 |
# TODO: Describe the command.
|
750.1.1
by Jeroen Vermeulen
Template for custom maas commands. |
34 |
help = "Purpose of this command." |
35 |
||
36 |
def handle(self, *args, **options): |
|
757.1.1
by Jeroen Vermeulen
Use TODO markers in templates. |
37 |
# TODO: Replace the lines below with your actual code.
|
750.1.1
by Jeroen Vermeulen
Template for custom maas commands. |
38 |
option = options.get('option', None) |
39 |
print(option) |