Fixed small bug in print_error() calls in django-admin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
99a75541fd
commit
47cc60d94b
|
@ -41,7 +41,7 @@ class DjangoOptionParser(OptionParser):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def print_error(msg, cmd):
|
def print_error(msg, cmd):
|
||||||
sys.stderr.write("Error: %s\nRun %s --help for help." % (msg, cmd))
|
sys.stderr.write('Error: %s\nRun "%s --help" for help.\n' % (msg, cmd))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -60,9 +60,9 @@ def main():
|
||||||
try:
|
try:
|
||||||
action = args[0]
|
action = args[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print_error("An 'action' is required.")
|
print_error("An action is required.", sys.argv[0])
|
||||||
if not ACTION_MAPPING.has_key(action):
|
if not ACTION_MAPPING.has_key(action):
|
||||||
print_error("Your 'action' was invalid.")
|
print_error("Your action, %r, was invalid." % action, sys.argv[0])
|
||||||
if action == 'init':
|
if action == 'init':
|
||||||
ACTION_MAPPING[action]()
|
ACTION_MAPPING[action]()
|
||||||
elif action in ('startapp', 'startproject'):
|
elif action in ('startapp', 'startproject'):
|
||||||
|
|
Loading…
Reference in New Issue