mirror of https://github.com/django/django.git
Wrapped some long lines and orginized imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6622 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
62c574e765
commit
1a3bca2b84
|
@ -1,8 +1,10 @@
|
||||||
from django.core.management.base import copy_helper, CommandError, LabelCommand
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from django.core.management.base import copy_helper, CommandError, LabelCommand
|
||||||
|
|
||||||
class Command(LabelCommand):
|
class Command(LabelCommand):
|
||||||
help = "Creates a Django app directory structure for the given app name in the current directory."
|
help = ("Creates a Django app directory structure for the given app name"
|
||||||
|
" in the current directory.")
|
||||||
args = "[appname]"
|
args = "[appname]"
|
||||||
label = 'application name'
|
label = 'application name'
|
||||||
|
|
||||||
|
@ -19,11 +21,13 @@ class Command(LabelCommand):
|
||||||
# current directory if no directory was passed).
|
# current directory if no directory was passed).
|
||||||
project_name = os.path.basename(directory)
|
project_name = os.path.basename(directory)
|
||||||
if app_name == project_name:
|
if app_name == project_name:
|
||||||
raise CommandError("You cannot create an app with the same name (%r) as your project." % app_name)
|
raise CommandError("You cannot create an app with the same name"
|
||||||
|
" (%r) as your project." % app_name)
|
||||||
copy_helper(self.style, 'app', app_name, directory, project_name)
|
copy_helper(self.style, 'app', app_name, directory, project_name)
|
||||||
|
|
||||||
class ProjectCommand(Command):
|
class ProjectCommand(Command):
|
||||||
help = "Creates a Django app directory structure for the given app name in this project's directory."
|
help = ("Creates a Django app directory structure for the given app name"
|
||||||
|
" in this project's directory.")
|
||||||
|
|
||||||
def __init__(self, project_directory):
|
def __init__(self, project_directory):
|
||||||
super(ProjectCommand, self).__init__()
|
super(ProjectCommand, self).__init__()
|
||||||
|
|
Loading…
Reference in New Issue