summaryrefslogtreecommitdiff
path: root/django/contrib/staticfiles
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/staticfiles')
-rw-r--r--django/contrib/staticfiles/management/commands/collectstatic.py43
-rw-r--r--django/contrib/staticfiles/management/commands/findstatic.py13
-rw-r--r--django/contrib/staticfiles/management/commands/runserver.py12
3 files changed, 44 insertions, 24 deletions
diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py
index 9ebc009590..1e4a577b0b 100644
--- a/django/contrib/staticfiles/management/commands/collectstatic.py
+++ b/django/contrib/staticfiles/management/commands/collectstatic.py
@@ -39,30 +39,43 @@ class Command(BaseCommand):
return True
def add_arguments(self, parser):
- parser.add_argument('--noinput', '--no-input',
+ parser.add_argument(
+ '--noinput', '--no-input',
action='store_false', dest='interactive', default=True,
- help="Do NOT prompt the user for input of any kind.")
- parser.add_argument('--no-post-process',
+ help="Do NOT prompt the user for input of any kind.",
+ )
+ parser.add_argument(
+ '--no-post-process',
action='store_false', dest='post_process', default=True,
- help="Do NOT post process collected files.")
- parser.add_argument('-i', '--ignore', action='append', default=[],
+ help="Do NOT post process collected files.",
+ )
+ parser.add_argument(
+ '-i', '--ignore', action='append', default=[],
dest='ignore_patterns', metavar='PATTERN',
help="Ignore files or directories matching this glob-style "
- "pattern. Use multiple times to ignore more.")
- parser.add_argument('-n', '--dry-run',
+ "pattern. Use multiple times to ignore more.",
+ )
+ parser.add_argument(
+ '-n', '--dry-run',
action='store_true', dest='dry_run', default=False,
- help="Do everything except modify the filesystem.")
- parser.add_argument('-c', '--clear',
+ help="Do everything except modify the filesystem.",
+ )
+ parser.add_argument(
+ '-c', '--clear',
action='store_true', dest='clear', default=False,
help="Clear the existing files using the storage "
- "before trying to copy or link the original file.")
- parser.add_argument('-l', '--link',
+ "before trying to copy or link the original file.",
+ )
+ parser.add_argument(
+ '-l', '--link',
action='store_true', dest='link', default=False,
- help="Create a symbolic link to each file instead of copying.")
- parser.add_argument('--no-default-ignore', action='store_false',
+ help="Create a symbolic link to each file instead of copying.",
+ )
+ parser.add_argument(
+ '--no-default-ignore', action='store_false',
dest='use_default_ignore_patterns', default=True,
- help="Don't ignore the common private glob-style patterns 'CVS', "
- "'.*' and '*~'.")
+ help="Don't ignore the common private glob-style patterns 'CVS', '.*' and '*~'.",
+ )
def set_options(self, **options):
"""
diff --git a/django/contrib/staticfiles/management/commands/findstatic.py b/django/contrib/staticfiles/management/commands/findstatic.py
index 367242fd21..dcb198b221 100644
--- a/django/contrib/staticfiles/management/commands/findstatic.py
+++ b/django/contrib/staticfiles/management/commands/findstatic.py
@@ -13,18 +13,21 @@ class Command(LabelCommand):
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
- parser.add_argument('--first', action='store_false', dest='all',
+ parser.add_argument(
+ '--first', action='store_false', dest='all',
default=True,
- help="Only return the first match for each static file.")
+ help="Only return the first match for each static file.",
+ )
def handle_label(self, path, **options):
verbosity = options['verbosity']
result = finders.find(path, all=options['all'])
path = force_text(path)
if verbosity >= 2:
- searched_locations = ("\nLooking in the following locations:\n %s" %
- "\n ".join(force_text(location)
- for location in finders.searched_locations))
+ searched_locations = (
+ "\nLooking in the following locations:\n %s" %
+ "\n ".join(force_text(location) for location in finders.searched_locations)
+ )
else:
searched_locations = ''
if result:
diff --git a/django/contrib/staticfiles/management/commands/runserver.py b/django/contrib/staticfiles/management/commands/runserver.py
index b6108b8e97..c25ac1f369 100644
--- a/django/contrib/staticfiles/management/commands/runserver.py
+++ b/django/contrib/staticfiles/management/commands/runserver.py
@@ -9,10 +9,14 @@ class Command(RunserverCommand):
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
- parser.add_argument('--nostatic', action="store_false", dest='use_static_handler', default=True,
- help='Tells Django to NOT automatically serve static files at STATIC_URL.')
- parser.add_argument('--insecure', action="store_true", dest='insecure_serving', default=False,
- help='Allows serving static files even if DEBUG is False.')
+ parser.add_argument(
+ '--nostatic', action="store_false", dest='use_static_handler', default=True,
+ help='Tells Django to NOT automatically serve static files at STATIC_URL.',
+ )
+ parser.add_argument(
+ '--insecure', action="store_true", dest='insecure_serving', default=False,
+ help='Allows serving static files even if DEBUG is False.',
+ )
def get_handler(self, *args, **options):
"""