summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorRay Ashman Jr <ray.ashman.jr@gmail.com>2013-11-02 15:27:47 -0400
committerRay Ashman Jr <ray.ashman.jr@gmail.com>2013-11-02 15:27:47 -0400
commitdcfc8fa9721955dc4fcfb6e5e506be12f74c5b85 (patch)
treedb0ff9bc296501a9f8eb5f7b44e3b49652103992 /django/utils
parentb44d42be6d05e88071844b64c6519223cdd2fa80 (diff)
Correct flake8 violation E261
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/autoreload.py2
-rw-r--r--django/utils/cache.py2
-rw-r--r--django/utils/checksums.py2
-rw-r--r--django/utils/dateformat.py2
-rw-r--r--django/utils/dates.py4
-rw-r--r--django/utils/dictconfig.py8
-rw-r--r--django/utils/html.py4
-rw-r--r--django/utils/html_parser.py12
-rw-r--r--django/utils/http.py2
9 files changed, 19 insertions, 19 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
index 66ffd0db4d..ca5beaf75a 100644
--- a/django/utils/autoreload.py
+++ b/django/utils/autoreload.py
@@ -257,7 +257,7 @@ def reloader_thread():
fn = code_changed
while RUN_RELOADER:
if fn():
- sys.exit(3) # force reload
+ sys.exit(3) # force reload
time.sleep(1)
diff --git a/django/utils/cache.py b/django/utils/cache.py
index f74056cafa..0d664afdf4 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -112,7 +112,7 @@ def patch_response_headers(response, cache_timeout=None):
if cache_timeout is None:
cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS
if cache_timeout < 0:
- cache_timeout = 0 # Can't have max-age negative
+ cache_timeout = 0 # Can't have max-age negative
if settings.USE_ETAGS and not response.has_header('ETag'):
if hasattr(response, 'render') and callable(response.render):
response.add_post_render_callback(_set_response_etag)
diff --git a/django/utils/checksums.py b/django/utils/checksums.py
index 7bd21c95e0..1113f3b796 100644
--- a/django/utils/checksums.py
+++ b/django/utils/checksums.py
@@ -6,7 +6,7 @@ __all__ = ['luhn']
from django.utils import six
-LUHN_ODD_LOOKUP = (0, 2, 4, 6, 8, 1, 3, 5, 7, 9) # sum_of_digits(index * 2)
+LUHN_ODD_LOOKUP = (0, 2, 4, 6, 8, 1, 3, 5, 7, 9) # sum_of_digits(index * 2)
def luhn(candidate):
"""
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py
index 2fe6760a88..27413a2e67 100644
--- a/django/utils/dateformat.py
+++ b/django/utils/dateformat.py
@@ -267,7 +267,7 @@ class DateFormat(TimeFormat):
def S(self):
"English ordinal suffix for the day of the month, 2 characters; i.e. 'st', 'nd', 'rd' or 'th'"
- if self.data.day in (11, 12, 13): # Special case
+ if self.data.day in (11, 12, 13): # Special case
return 'th'
last = self.data.day % 10
if last == 1:
diff --git a/django/utils/dates.py b/django/utils/dates.py
index 37746294b8..25f092e618 100644
--- a/django/utils/dates.py
+++ b/django/utils/dates.py
@@ -27,7 +27,7 @@ MONTHS_3_REV = {
'jan': 1, 'feb': 2, 'mar': 3, 'apr': 4, 'may': 5, 'jun': 6, 'jul': 7, 'aug': 8,
'sep': 9, 'oct': 10, 'nov': 11, 'dec': 12
}
-MONTHS_AP = { # month names in Associated Press style
+MONTHS_AP = { # month names in Associated Press style
1: pgettext_lazy('abbrev. month', 'Jan.'),
2: pgettext_lazy('abbrev. month', 'Feb.'),
3: pgettext_lazy('abbrev. month', 'March'),
@@ -41,7 +41,7 @@ MONTHS_AP = { # month names in Associated Press style
11: pgettext_lazy('abbrev. month', 'Nov.'),
12: pgettext_lazy('abbrev. month', 'Dec.')
}
-MONTHS_ALT = { # required for long date representation by some locales
+MONTHS_ALT = { # required for long date representation by some locales
1: pgettext_lazy('alt. month', 'January'),
2: pgettext_lazy('alt. month', 'February'),
3: pgettext_lazy('alt. month', 'March'),
diff --git a/django/utils/dictconfig.py b/django/utils/dictconfig.py
index c676035dc7..d01b785001 100644
--- a/django/utils/dictconfig.py
+++ b/django/utils/dictconfig.py
@@ -210,7 +210,7 @@ class BaseConfigurator(object):
d = d[idx]
else:
try:
- n = int(idx) # try as number first (most likely)
+ n = int(idx) # try as number first (most likely)
d = d[n]
except TypeError:
d = d[idx]
@@ -238,7 +238,7 @@ class BaseConfigurator(object):
isinstance(value, tuple):
value = ConvertingTuple(value)
value.configurator = self
- elif isinstance(value, six.string_types): # str for py3k
+ elif isinstance(value, six.string_types): # str for py3k
m = self.CONVERT_PATTERN.match(value)
if m:
d = m.groupdict()
@@ -385,7 +385,7 @@ class DictConfigurator(BaseConfigurator):
prefixed = name + "."
pflen = len(prefixed)
num_existing = len(existing)
- i = i + 1 # look at the entry after name
+ i = i + 1 # look at the entry after name
while (i < num_existing) and\
(existing[i][:pflen] == prefixed):
child_loggers.append(existing[i])
@@ -425,7 +425,7 @@ class DictConfigurator(BaseConfigurator):
def configure_formatter(self, config):
"""Configure a formatter from a dictionary."""
if '()' in config:
- factory = config['()'] # for use in exception handler
+ factory = config['()'] # for use in exception handler
try:
result = self.configure_custom(config)
except TypeError as te:
diff --git a/django/utils/html.py b/django/utils/html.py
index 81b06efeef..5b2416f03f 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -175,8 +175,8 @@ def smart_urlquote(url):
try:
scheme, netloc, path, query, fragment = urlsplit(url)
try:
- netloc = netloc.encode('idna').decode('ascii') # IDN -> ACE
- except UnicodeError: # invalid domain part
+ netloc = netloc.encode('idna').decode('ascii') # IDN -> ACE
+ except UnicodeError: # invalid domain part
pass
else:
url = urlunsplit((scheme, netloc, path, query, fragment))
diff --git a/django/utils/html_parser.py b/django/utils/html_parser.py
index 2a408e9f55..fe71172cfd 100644
--- a/django/utils/html_parser.py
+++ b/django/utils/html_parser.py
@@ -84,22 +84,22 @@ else:
else:
self.handle_starttag(tag, attrs)
if tag in self.CDATA_CONTENT_ELEMENTS:
- self.set_cdata_mode(tag) # <--------------------------- Changed
+ self.set_cdata_mode(tag) # <--------------------------- Changed
return endpos
# Internal -- parse endtag, return end or -1 if incomplete
def parse_endtag(self, i):
rawdata = self.rawdata
assert rawdata[i:i + 2] == "</", "unexpected call to parse_endtag"
- match = _html_parser.endendtag.search(rawdata, i + 1) # >
+ match = _html_parser.endendtag.search(rawdata, i + 1) # >
if not match:
return -1
j = match.end()
- match = _html_parser.endtagfind.match(rawdata, i) # </ + tag + >
+ match = _html_parser.endtagfind.match(rawdata, i) # </ + tag + >
if not match:
- if self.cdata_tag is not None: # *** add ***
- self.handle_data(rawdata[i:j]) # *** add ***
- return j # *** add ***
+ if self.cdata_tag is not None: # *** add ***
+ self.handle_data(rawdata[i:j]) # *** add ***
+ return j # *** add ***
self.error("bad end tag: %r" % (rawdata[i:j],))
# --- changed start ---------------------------------------------------
tag = match.group(1).strip()
diff --git a/django/utils/http.py b/django/utils/http.py
index 897b1456c4..413ac72a08 100644
--- a/django/utils/http.py
+++ b/django/utils/http.py
@@ -211,7 +211,7 @@ def urlsafe_base64_decode(s):
Decodes a base64 encoded string, adding back any trailing equal signs that
might have been stripped.
"""
- s = s.encode('utf-8') # base64encode should only return ASCII.
+ s = s.encode('utf-8') # base64encode should only return ASCII.
try:
return base64.urlsafe_b64decode(s.ljust(len(s) + len(s) % 4, b'='))
except (LookupError, BinasciiError) as e: