Skip to content

Commit c347f78

Browse files
committed
Fixed all E226 violations
1 parent 7288e1b commit c347f78

51 files changed

Lines changed: 150 additions & 150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

django/contrib/admin/templatetags/admin_list.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def paginator_number(cl, i):
3434
if i == DOT:
3535
return '... '
3636
elif i == cl.page_num:
37-
return format_html('<span class="this-page">{0}</span> ', i+1)
37+
return format_html('<span class="this-page">{0}</span> ', i + 1)
3838
else:
3939
return format_html('<a href="{0}"{1}>{2}</a> ',
4040
cl.get_query_string({PAGE_VAR: i}),
41-
mark_safe(' class="end"' if i == cl.paginator.num_pages-1 else ''),
42-
i+1)
41+
mark_safe(' class="end"' if i == cl.paginator.num_pages - 1 else ''),
42+
i + 1)
4343

4444

4545
@register.inclusion_tag('admin/pagination.html')

django/contrib/admin/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def reverse_field_path(model, path):
412412
for piece in pieces:
413413
field, model, direct, m2m = parent._meta.get_field_by_name(piece)
414414
# skip trailing data field if extant:
415-
if len(reversed_path) == len(pieces)-1: # final iteration
415+
if len(reversed_path) == len(pieces) - 1: # final iteration
416416
try:
417417
get_model_from_relation(field)
418418
except NotRelationField:

django/contrib/admin/views/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def get_results(self, request):
236236
result_list = self.queryset._clone()
237237
else:
238238
try:
239-
result_list = paginator.page(self.page_num+1).object_list
239+
result_list = paginator.page(self.page_num + 1).object_list
240240
except InvalidPage:
241241
raise IncorrectLookupParameters
242242

django/contrib/gis/geos/mutable_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __imul__(self, n):
145145
del self[:]
146146
else:
147147
cache = list(self)
148-
for i in range(n-1):
148+
for i in range(n - 1):
149149
self.extend(cache)
150150
return self
151151

django/contrib/gis/geos/polygon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _get_single_internal(self, index):
134134
return capi.get_extring(self.ptr)
135135
else:
136136
# Getting the interior ring, have to subtract 1 from the index.
137-
return capi.get_intring(self.ptr, index-1)
137+
return capi.get_intring(self.ptr, index - 1)
138138

139139
def _get_single_external(self, index):
140140
return GEOSGeometry(capi.geom_clone(self._get_single_internal(index)), srid=self.srid)
@@ -170,6 +170,6 @@ def tuple(self):
170170
@property
171171
def kml(self):
172172
"Returns the KML representation of this Polygon."
173-
inner_kml = ''.join("<innerBoundaryIs>%s</innerBoundaryIs>" % self[i+1].kml
173+
inner_kml = ''.join("<innerBoundaryIs>%s</innerBoundaryIs>" % self[i + 1].kml
174174
for i in xrange(self.num_interior_rings))
175175
return "<Polygon><outerBoundaryIs>%s</outerBoundaryIs>%s</Polygon>" % (self[0].kml, inner_kml)

django/contrib/gis/geos/tests/test_geos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,11 +1081,11 @@ def test_linearref(self):
10811081

10821082
self.assertEqual(ls.project(Point(0, 20)), 10.0)
10831083
self.assertEqual(ls.project(Point(7, 6)), 24)
1084-
self.assertEqual(ls.project_normalized(Point(0, 20)), 1.0/3)
1084+
self.assertEqual(ls.project_normalized(Point(0, 20)), 1.0 / 3)
10851085

10861086
self.assertEqual(ls.interpolate(10), Point(0, 10))
10871087
self.assertEqual(ls.interpolate(24), Point(10, 6))
1088-
self.assertEqual(ls.interpolate_normalized(1.0/3), Point(0, 10))
1088+
self.assertEqual(ls.interpolate_normalized(1.0 / 3), Point(0, 10))
10891089

10901090
self.assertEqual(mls.project(Point(0, 20)), 10)
10911091
self.assertEqual(mls.project(Point(7, 6)), 16)

django/contrib/gis/geos/tests/test_mutable_list.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ def test_11_sorting(self):
349349
ul.sort()
350350
self.assertEqual(pl[:], ul[:], 'sort')
351351
mid = pl[len(pl) // 2]
352-
pl.sort(key=lambda x: (mid-x)**2)
353-
ul.sort(key=lambda x: (mid-x)**2)
352+
pl.sort(key=lambda x: (mid - x) ** 2)
353+
ul.sort(key=lambda x: (mid - x) ** 2)
354354
self.assertEqual(pl[:], ul[:], 'sort w/ key')
355355

356356
pl.insert(0, pl.pop())
@@ -359,8 +359,8 @@ def test_11_sorting(self):
359359
ul.sort(reverse=True)
360360
self.assertEqual(pl[:], ul[:], 'sort w/ reverse')
361361
mid = pl[len(pl) // 2]
362-
pl.sort(key=lambda x: (mid-x)**2)
363-
ul.sort(key=lambda x: (mid-x)**2)
362+
pl.sort(key=lambda x: (mid - x) ** 2)
363+
ul.sort(key=lambda x: (mid - x) ** 2)
364364
self.assertEqual(pl[:], ul[:], 'sort w/ key')
365365

366366
def test_12_arithmetic(self):

django/contrib/gis/maps/google/zoom.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def lonlat_to_pixel(self, lonlat, zoom):
7979
fac = min(max(sin(DTOR * lat), -0.9999), 0.9999)
8080

8181
# Calculating the pixel y coordinate.
82-
px_y = round(npix + (0.5 * log((1 + fac)/(1 - fac)) * (-1.0 * self._radpp[zoom])))
82+
px_y = round(npix + (0.5 * log((1 + fac) / (1 - fac)) * (-1.0 * self._radpp[zoom])))
8383

8484
# Returning the pixel x, y to the caller of the function.
8585
return (px_x, px_y)
@@ -116,8 +116,8 @@ def tile(self, lonlat, zoom):
116116

117117
# Getting the lower-left and upper-right lat/lon coordinates
118118
# for the bounding box of the tile.
119-
ll = self.pixel_to_lonlat((px[0]-delta, px[1]-delta), zoom)
120-
ur = self.pixel_to_lonlat((px[0]+delta, px[1]+delta), zoom)
119+
ll = self.pixel_to_lonlat((px[0] - delta, px[1] - delta), zoom)
120+
ur = self.pixel_to_lonlat((px[0] + delta, px[1] + delta), zoom)
121121

122122
# Constructing the Polygon, representing the tile and returning.
123123
return Polygon(LinearRing(ll, (ll[0], ur[1]), ur, (ur[0], ll[1]), ll), srid=4326)
@@ -143,10 +143,10 @@ def get_zoom(self, geom):
143143
if (env_w > tile_w) or (env_h > tile_h):
144144
if z == 0:
145145
raise GoogleMapException('Geometry width and height should not exceed that of the Earth.')
146-
return z-1
146+
return z - 1
147147

148148
# Otherwise, we've zoomed in to the max.
149-
return self._nzoom-1
149+
return self._nzoom - 1
150150

151151
def get_width_height(self, extent):
152152
"""

django/contrib/gis/sitemaps/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def index(request, sitemaps):
3232
sites.append('%s://%s%s' % (protocol, current_site.domain, sitemap_url))
3333

3434
if pages > 1:
35-
for page in range(2, pages+1):
35+
for page in range(2, pages + 1):
3636
sites.append('%s://%s%s?p=%s' % (protocol, current_site.domain, sitemap_url, page))
3737
xml = loader.render_to_string('sitemap_index.xml', {'sitemaps': sites})
3838
return HttpResponse(xml, content_type='application/xml')

django/contrib/gis/tests/test_measure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def testMultiplication(self):
9494

9595
a5 = d1 * D(m=10)
9696
self.assertTrue(isinstance(a5, Area))
97-
self.assertEqual(a5.sq_m, 100*10)
97+
self.assertEqual(a5.sq_m, 100 * 10)
9898

9999
with self.assertRaises(TypeError):
100100
d1 *= D(m=1)

0 commit comments

Comments
 (0)