More flake8 fixes

This commit is contained in:
Kudlaty
2013-04-16 10:44:07 +02:00
parent c6dbc9fe0e
commit 44647b72f1
5 changed files with 4 additions and 47 deletions

View File

@@ -136,7 +136,7 @@ class CompilerFilter(FilterBase):
# something different than utf8. If that's the case file will
# be included with charset="something" html attribute and
# charset will be available as filter's charset attribute
encoding = self.charset #or self.default_encoding
encoding = self.charset # or self.default_encoding
self.infile = open(self.filename)
options["infile"] = self.filename

View File

@@ -30,14 +30,6 @@
import re
try:
from cStringIO import StringIO
except ImportError:
try:
from StringIO import StringIO
except ImportError:
from io import StringIO # python 3
__version__ = '0.1.4'

View File

@@ -74,9 +74,9 @@ class Command(NoArgsCommand):
if keys_to_delete:
cache.delete_many(list(keys_to_delete))
print "Deleted mtimes of %d files from the cache." % len(keys_to_delete)
print("Deleted mtimes of %d files from the cache." % len(keys_to_delete))
if files_to_add:
for filename in files_to_add:
get_mtime(filename)
print "Added mtimes of %d files to cache." % len(files_to_add)
print("Added mtimes of %d files to cache." % len(files_to_add))

View File

@@ -1,35 +0,0 @@
# noqa
import six
try:
from django.utils.encoding import force_text, force_bytes
from django.utils.encoding import smart_text, smart_bytes
except ImportError:
# django < 1.4.2
from django.utils.encoding import force_unicode as force_text
from django.utils.encoding import force_str as force_bytes
from django.utils.encoding import smart_unicode as smart_text
from django.utils.encoding import smart_str as smart_bytes
try:
from django.utils import unittest
except ImportError:
import unittest2 as unittest
if six.PY3:
# there is an 'io' module in python 2.6+, but io.StringIO does not
# accept regular strings, just unicode objects
from io import StringIO
else:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from urllib.request import url2pathname
except ImportError:
from urllib import url2pathname

View File

@@ -250,7 +250,7 @@ def selftest():
d = datetime.date(2010, 9, 7)
assert F(u"The year is {0.year}").format(d) == u"The year is 2010"
assert F(u"Tested on {0:%Y-%m-%d}").format(d) == u"Tested on 2010-09-07"
print 'Test successful'
print('Test successful')
if __name__ == '__main__':
selftest()