Fixed #21266 -- Fixed E201,E202 pep8 warnings.
This commit is contained in:
parent
42a67ec1cd
commit
83b9bfea44
|
@ -19,7 +19,8 @@ class OGRIndexError(OGRException, KeyError):
|
||||||
#### OGR error checking codes and routine ####
|
#### OGR error checking codes and routine ####
|
||||||
|
|
||||||
# OGR Error Codes
|
# OGR Error Codes
|
||||||
OGRERR_DICT = { 1 : (OGRException, 'Not enough data.'),
|
OGRERR_DICT = {
|
||||||
|
1: (OGRException, 'Not enough data.'),
|
||||||
2: (OGRException, 'Not enough memory.'),
|
2: (OGRException, 'Not enough memory.'),
|
||||||
3: (OGRException, 'Unsupported geometry type.'),
|
3: (OGRException, 'Unsupported geometry type.'),
|
||||||
4: (OGRException, 'Unsupported operation.'),
|
4: (OGRException, 'Unsupported operation.'),
|
||||||
|
|
|
@ -178,7 +178,8 @@ class OFTStringList(Field): pass
|
||||||
class OFTWideStringList(Field): pass
|
class OFTWideStringList(Field): pass
|
||||||
|
|
||||||
# Class mapping dictionary for OFT Types and reverse mapping.
|
# Class mapping dictionary for OFT Types and reverse mapping.
|
||||||
OGRFieldTypes = { 0 : OFTInteger,
|
OGRFieldTypes = {
|
||||||
|
0: OFTInteger,
|
||||||
1: OFTIntegerList,
|
1: OFTIntegerList,
|
||||||
2: OFTReal,
|
2: OFTReal,
|
||||||
3: OFTRealList,
|
3: OFTRealList,
|
||||||
|
|
|
@ -22,7 +22,8 @@ class GeoIPRecord(Structure):
|
||||||
('continent_code', c_char_p),
|
('continent_code', c_char_p),
|
||||||
]
|
]
|
||||||
geoip_char_fields = [name for name, ctype in GeoIPRecord._fields_ if ctype is 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',
|
1: 'utf8',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -459,10 +459,12 @@ class GeoQuerySetTest(TestCase):
|
||||||
@no_spatialite
|
@no_spatialite
|
||||||
def test_force_rhr(self):
|
def test_force_rhr(self):
|
||||||
"Testing GeoQuerySet.force_rhr()."
|
"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)),
|
((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)),
|
((1, 1), (3, 1), (1, 3), (1, 1)),
|
||||||
)
|
)
|
||||||
State.objects.create(name='Foo', poly=Polygon(*rings))
|
State.objects.create(name='Foo', poly=Polygon(*rings))
|
||||||
|
|
|
@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py
|
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]
|
[metadata]
|
||||||
license-file = LICENSE
|
license-file = LICENSE
|
||||||
|
|
|
@ -101,7 +101,7 @@ class CustomRedirects(TestCase):
|
||||||
new object.
|
new object.
|
||||||
Refs 8001, 18310, 19505.
|
Refs 8001, 18310, 19505.
|
||||||
"""
|
"""
|
||||||
post_data = { 'name': 'John Doe', }
|
post_data = {'name': 'John Doe'}
|
||||||
self.assertEqual(Person.objects.count(), 0)
|
self.assertEqual(Person.objects.count(), 0)
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
reverse('admin:admin_custom_urls_person_add'), post_data)
|
reverse('admin:admin_custom_urls_person_add'), post_data)
|
||||||
|
@ -120,7 +120,7 @@ class CustomRedirects(TestCase):
|
||||||
Person.objects.create(name='John Doe')
|
Person.objects.create(name='John Doe')
|
||||||
self.assertEqual(Person.objects.count(), 1)
|
self.assertEqual(Person.objects.count(), 1)
|
||||||
person = Person.objects.all()[0]
|
person = Person.objects.all()[0]
|
||||||
post_data = { 'name': 'Jack Doe', }
|
post_data = {'name': 'Jack Doe'}
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
reverse('admin:admin_custom_urls_person_change', args=[person.pk]), post_data)
|
reverse('admin:admin_custom_urls_person_change', args=[person.pk]), post_data)
|
||||||
self.assertRedirects(
|
self.assertRedirects(
|
||||||
|
|
|
@ -367,7 +367,9 @@ class AdminFileWidgetTest(DjangoTestCase):
|
||||||
w = widgets.AdminFileWidget()
|
w = widgets.AdminFileWidget()
|
||||||
self.assertHTMLEqual(
|
self.assertHTMLEqual(
|
||||||
w.render('test', album.cover_art),
|
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(
|
self.assertHTMLEqual(
|
||||||
|
|
Loading…
Reference in New Issue