added help message for django.startapp
This commit is contained in:
parent
cb0eff3c4e
commit
2237dd4856
1 changed files with 16 additions and 4 deletions
|
|
@ -129,23 +129,35 @@ def run(args=None):
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def startapp(args):
|
def startapp(appname='help'):
|
||||||
"""
|
"""
|
||||||
wrapper for the django.startapp
|
wrapper for the django.startapp
|
||||||
|
|
||||||
takes name of app and creates in in code/apps
|
takes name of app and creates in in code/apps
|
||||||
|
|
||||||
args - name of app
|
appname - name of app
|
||||||
"""
|
"""
|
||||||
configuration = env.config
|
configuration = env.config
|
||||||
|
|
||||||
destination = os.path.join(configuration.paths.django.apps, args)
|
msg_help = """
|
||||||
|
django.startapp takes one of two values:
|
||||||
|
\thelp - this help message
|
||||||
|
\tappname - the name of the app you want to start
|
||||||
|
"""
|
||||||
|
|
||||||
|
from utils import handle_help
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if handle_help(appname, msg_help, 'help'):
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
destination = os.path.join(configuration.paths.django.apps, appname)
|
||||||
|
|
||||||
cmd_mkdir = "mkdir {destination}".format(
|
cmd_mkdir = "mkdir {destination}".format(
|
||||||
destination=destination)
|
destination=destination)
|
||||||
|
|
||||||
command = "startapp {appname} {destination}".format(
|
command = "startapp {appname} {destination}".format(
|
||||||
appname=args,
|
appname=appname,
|
||||||
destination=destination)
|
destination=destination)
|
||||||
|
|
||||||
fabric_ops.run(cmd_mkdir)
|
fabric_ops.run(cmd_mkdir)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue