Fixed #21266 -- Fixed E201,E202 pep8 warnings.

This commit is contained in:
Larry O'Neill 2013-10-14 20:13:14 +01:00 committed by Tim Graham
parent 42a67ec1cd
commit 83b9bfea44
35 changed files with 152 additions and 145 deletions

View File

@ -19,7 +19,8 @@ class OGRIndexError(OGRException, KeyError):
#### OGR error checking codes and routine ####
# OGR Error Codes
OGRERR_DICT = { 1 : (OGRException, 'Not enough data.'),
OGRERR_DICT = {
1: (OGRException, 'Not enough data.'),
2: (OGRException, 'Not enough memory.'),
3: (OGRException, 'Unsupported geometry type.'),
4: (OGRException, 'Unsupported operation.'),

View File

@ -178,7 +178,8 @@ class OFTStringList(Field): pass
class OFTWideStringList(Field): pass
# Class mapping dictionary for OFT Types and reverse mapping.
OGRFieldTypes = { 0 : OFTInteger,
OGRFieldTypes = {
0: OFTInteger,
1: OFTIntegerList,
2: OFTReal,
3: OFTRealList,

View File

@ -22,7 +22,8 @@ class GeoIPRecord(Structure):
('continent_code', c_char_p),
]
geoip_char_fields = [name for name, ctype in GeoIPRecord._fields_ if ctype is c_char_p]
geoip_encodings = { 0: 'iso-8859-1',
geoip_encodings = {
0: 'iso-8859-1',
1: 'utf8',
}

View File

@ -459,10 +459,12 @@ class GeoQuerySetTest(TestCase):
@no_spatialite
def test_force_rhr(self):
"Testing GeoQuerySet.force_rhr()."
rings = ( ( (0, 0), (5, 0), (0, 5), (0, 0) ),
rings = (
((0, 0), (5, 0), (0, 5), (0, 0)),
((1, 1), (1, 3), (3, 1), (1, 1)),
)
rhr_rings = ( ( (0, 0), (0, 5), (5, 0), (0, 0) ),
rhr_rings = (
((0, 0), (0, 5), (5, 0), (0, 0)),
((1, 1), (3, 1), (1, 3), (1, 1)),
)
State.objects.create(name='Foo', poly=Polygon(*rings))

View File

@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
[flake8]
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py
ignore=E123,E124,E125,E126,E127,E128,E225,E226,E241,E251,E302,E501,E121,E122,E201,E202,E203,E221,E227,E231,E261,E301,E303,E502,E701,F401,F403,F841,W601
ignore=E123,E124,E125,E126,E127,E128,E225,E226,E241,E251,E302,E501,E121,E122,E203,E221,E227,E231,E261,E301,E303,E502,E701,F401,F403,F841,W601
[metadata]
license-file = LICENSE

View File

@ -101,7 +101,7 @@ class CustomRedirects(TestCase):
new object.
Refs 8001, 18310, 19505.
"""
post_data = { 'name': 'John Doe', }
post_data = {'name': 'John Doe'}
self.assertEqual(Person.objects.count(), 0)
response = self.client.post(
reverse('admin:admin_custom_urls_person_add'), post_data)
@ -120,7 +120,7 @@ class CustomRedirects(TestCase):
Person.objects.create(name='John Doe')
self.assertEqual(Person.objects.count(), 1)
person = Person.objects.all()[0]
post_data = { 'name': 'Jack Doe', }
post_data = {'name': 'Jack Doe'}
response = self.client.post(
reverse('admin:admin_custom_urls_person_change', args=[person.pk]), post_data)
self.assertRedirects(

View File

@ -367,7 +367,9 @@ class AdminFileWidgetTest(DjangoTestCase):
w = widgets.AdminFileWidget()
self.assertHTMLEqual(
w.render('test', album.cover_art),
'<p class="file-upload">Currently: <a href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>' % { 'STORAGE_URL': default_storage.url('') },
'<p class="file-upload">Currently: <a href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>' % {
'STORAGE_URL': default_storage.url('')
},
)
self.assertHTMLEqual(