added help message to django.generate
This commit is contained in:
parent
4ccbe25f25
commit
33b11f3df8
1 changed files with 22 additions and 6 deletions
|
|
@ -380,7 +380,7 @@ def generate_scripts(template_name, make_copy=False):
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def generate(param=None, make_copy=False):
|
def generate(param="help", make_copy=False):
|
||||||
"""
|
"""
|
||||||
param can be one of settings, local, wsgi
|
param can be one of settings, local, wsgi
|
||||||
make_copy must be set to True if you want it to actually do anthing
|
make_copy must be set to True if you want it to actually do anthing
|
||||||
|
|
@ -392,12 +392,28 @@ def generate(param=None, make_copy=False):
|
||||||
|
|
||||||
make_copy = booleanize(make_copy)
|
make_copy = booleanize(make_copy)
|
||||||
|
|
||||||
if param and param not in PARAM_LIST:
|
if param:
|
||||||
err_msg = "You asked to generate %s, that value isn't available" \
|
|
||||||
" possible script values available: %s" % (param, PARAM_LIST)
|
|
||||||
|
|
||||||
import sys
|
err_msg = None
|
||||||
sys.exit(err_msg)
|
|
||||||
|
if param == "help":
|
||||||
|
err_msg = """
|
||||||
|
|
||||||
|
fab django.generate:param="help",make_copy=False
|
||||||
|
|
||||||
|
param - file to be generated can be of type: %s
|
||||||
|
|
||||||
|
make_copy - determines whether or generate copies the generated file
|
||||||
|
into it's practical location (otherwise doesn't do anything)
|
||||||
|
""" % PARAM_LIST
|
||||||
|
|
||||||
|
elif param not in PARAM_LIST:
|
||||||
|
err_msg = "You asked to generate %s, that value isn't available" \
|
||||||
|
" possible script values available: %s" % (param, PARAM_LIST)
|
||||||
|
|
||||||
|
if err_msg:
|
||||||
|
import sys
|
||||||
|
sys.exit(err_msg)
|
||||||
|
|
||||||
print("django:generate make_copy : %s\n" % make_copy)
|
print("django:generate make_copy : %s\n" % make_copy)
|
||||||
print("django:generate script : %s" % param)
|
print("django:generate script : %s" % param)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue