Repository navigation
Expand file tree
/
Copy pathcommand.tmpl
More file actions
42 lines (40 loc) · 1.59 KB
/
Copy pathcommand.tmpl
File metadata and controls
42 lines (40 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class {{=name.title()}}Command({{if has_subcommands:}}CommandManager{{else:}}Command{{pass}}):
#change the name to real command name, such as makeapp, makeproject, etc.
name = '{{=name}}'
#command line parameters definition
option_list = (
make_option('-d', '--demo', dest='demo', default=False, action='store_true',
help='Demo command demo.'),
)
#help information
help = ''
#args information, used to display show the command usage message
args = ''
#if True, it'll check the current directory should has apps directory
check_apps_dirs = True
#if True, it'll check args parameters should be valid apps name
check_apps = False
#if True, it'll skip not predefined parameters in options_list, otherwise it'll
#complain not the right parameters of the command, it'll used in subcommands or
#passing extra parameters to a special command
skip_options = {{=has_subcommands}}
#if inherit the base class option_list, default True is inherit
options_inherit = True
{{if not has_subcommands:}}
def handle(self, options, global_options, *args):
print 'This is a demo of DemoCommand, you can enter: '
print
print ' uliweb help demo'
print
print 'to test this command'
print
print 'options=', options
print 'global_options=', global_options
print 'args=', args
{{pass}}
{{if has_subcommands:}}
def get_commands(self, global_options):
import {{=name}}_subcommands as subcommands
cmds = get_commands(subcommands)
return cmds
{{pass}}