Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing some linting bugs.

  • Loading branch information...
commit afbf99150b898de07b040fb5b5855956b722b164 1 parent ec0827d
Jannis Leidel authored
2  staticfiles/context_processors.py
View
@@ -1,12 +1,14 @@
import warnings
from django.conf import settings
+
def static(request):
"""
Adds static-related context variables to the context.
"""
return {'STATIC_URL': settings.STATIC_URL}
+
def static_url(request):
warnings.warn(
"The context processor 'staticfiles.context_processors.static_url' "
1  staticfiles/management/commands/findstatic.py
View
@@ -6,6 +6,7 @@
from staticfiles import finders
+
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
args = "[file ...]"
3  staticfiles/templatetags/static.py
View
@@ -3,6 +3,7 @@
register = template.Library()
+
class PrefixNode(template.Node):
def __repr__(self):
@@ -47,6 +48,7 @@ def render(self, context):
context[self.varname] = prefix
return ''
+
@register.tag
def get_static_prefix(parser, token):
"""
@@ -65,6 +67,7 @@ def get_static_prefix(parser, token):
"""
return PrefixNode.handle_token(parser, token, "STATIC_URL")
+
@register.tag
def get_media_prefix(parser, token):
"""
4 staticfiles/tests/tests.py
View
@@ -20,7 +20,7 @@
try:
from django.utils.functional import empty
except ImportError:
- empty = None
+ empty = None # noqa
from staticfiles import finders, storage
from staticfiles.conf import settings
@@ -37,7 +37,7 @@ def rmtree_errorhandler(func, path, exc_info):
"""
exctype, value = exc_info[:2]
# lookin for a windows error
- if exctype is not WindowsError or 'Access is denied' not in str(value):
+ if exctype is not WindowsError or 'Access is denied' not in str(value): # noqa
raise
# file type should currently be read only
if ((os.stat(path).st_mode & stat.S_IREAD) != stat.S_IREAD):
2  staticfiles/tests/urls/default.py
View
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import * # noqa
urlpatterns = patterns('',
url(r'^static/(?P<path>.*)$', 'staticfiles.views.serve'),
2  staticfiles/tests/urls/helper.py
View
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import * # noqa
from staticfiles.urls import staticfiles_urlpatterns
urlpatterns = staticfiles_urlpatterns()
5 staticfiles/utils.py
View
@@ -17,6 +17,7 @@ def get_files_for_app(app, ignore_patterns=None):
"instead.", DeprecationWarning)
return AppStaticStorage(app).get_files(ignore_patterns)
+
def get_app_prefix(app):
"""
Return the path name that should be prepended to files for this app.
@@ -28,6 +29,7 @@ def get_app_prefix(app):
"instead.", DeprecationWarning)
return AppStaticStorage(app).get_prefix()
+
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
@@ -40,6 +42,7 @@ def matches_patterns(path, patterns=None):
return True
return False
+
def get_filtered_patterns(storage, ignore_patterns=None, location=''):
"""
Return a filtered list of patterns that match the storage location.
@@ -62,6 +65,7 @@ def get_filtered_patterns(storage, ignore_patterns=None, location=''):
ignore_filtered.append(tail)
return ignore_filtered
+
def get_files(storage, ignore_patterns=None, location=''):
"""
Recursively walk the storage directories yielding the paths
@@ -84,4 +88,3 @@ def get_files(storage, ignore_patterns=None, location=''):
dir = os.path.join(location, dir)
for fn in get_files(storage, ignore_patterns, dir):
yield fn
-
Please sign in to comment.
Something went wrong with that request. Please try again.