summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-10-23 06:09:29 -0400
committerTim Graham <timograham@gmail.com>2013-10-23 06:09:29 -0400
commitae48d77ef8e14dae76fddcd5a677b897c7c7c4ae (patch)
treefc938daf79b1061aeb70c9d7dd33108d2eb63544 /django
parent51d2e1fb233b5507bf14300787939717c4d93834 (diff)
Fixed E225 pep8 warnings.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/db/backends/postgis/operations.py2
-rw-r--r--django/contrib/gis/db/models/proxy.py2
-rw-r--r--django/contrib/gis/gdal/geomtype.py2
-rw-r--r--django/contrib/gis/gdal/prototypes/srs.py2
-rw-r--r--django/contrib/gis/geos/linestring.py2
-rw-r--r--django/contrib/gis/geos/prototypes/prepared.py2
-rw-r--r--django/contrib/gis/maps/google/gmap.py2
-rw-r--r--django/contrib/gis/maps/google/overlays.py4
-rw-r--r--django/contrib/gis/maps/google/zoom.py2
-rw-r--r--django/contrib/gis/tests/test_geoforms.py14
-rw-r--r--django/contrib/gis/tests/test_measure.py2
-rw-r--r--django/contrib/messages/tests/base.py12
-rw-r--r--django/contrib/redirects/models.py2
-rw-r--r--django/contrib/sites/managers.py2
-rw-r--r--django/core/management/commands/makemessages.py2
-rw-r--r--django/dispatch/saferef.py2
-rw-r--r--django/forms/widgets.py2
-rw-r--r--django/utils/datastructures.py2
-rw-r--r--django/utils/dateformat.py2
-rw-r--r--django/utils/datetime_safe.py2
20 files changed, 32 insertions, 32 deletions
diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py
index 1d29b394e0..80bcb10e9c 100644
--- a/django/contrib/gis/db/backends/postgis/operations.py
+++ b/django/contrib/gis/db/backends/postgis/operations.py
@@ -456,7 +456,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
def exactly_two(np):
return np == 2
def two_to_three(np):
- return np >= 2 and np <=3
+ return np >= 2 and np <= 3
if (lookup_type in self.distance_functions and
lookup_type != 'dwithin'):
return two_to_three(num_param)
diff --git a/django/contrib/gis/db/models/proxy.py b/django/contrib/gis/db/models/proxy.py
index d55397fd44..513bf921bd 100644
--- a/django/contrib/gis/db/models/proxy.py
+++ b/django/contrib/gis/db/models/proxy.py
@@ -32,7 +32,7 @@ class GeometryProxy(object):
if isinstance(geom_value, self._klass):
geom = geom_value
- elif (geom_value is None) or (geom_value==''):
+ elif (geom_value is None) or (geom_value == ''):
geom = None
else:
# Otherwise, a Geometry object is built using the field's contents,
diff --git a/django/contrib/gis/gdal/geomtype.py b/django/contrib/gis/gdal/geomtype.py
index 8a1ce5e544..1b1547c341 100644
--- a/django/contrib/gis/gdal/geomtype.py
+++ b/django/contrib/gis/gdal/geomtype.py
@@ -37,7 +37,7 @@ class OGRGeomType(object):
elif isinstance(type_input, six.string_types):
type_input = type_input.lower()
if type_input == 'geometry':
- type_input='unknown'
+ type_input = 'unknown'
num = self._str_types.get(type_input, None)
if num is None:
raise OGRException('Invalid OGR String Type "%s"' % type_input)
diff --git a/django/contrib/gis/gdal/prototypes/srs.py b/django/contrib/gis/gdal/prototypes/srs.py
index 58ceb75456..29a73ddcc7 100644
--- a/django/contrib/gis/gdal/prototypes/srs.py
+++ b/django/contrib/gis/gdal/prototypes/srs.py
@@ -67,5 +67,5 @@ islocal = int_output(lgdal.OSRIsLocal, [c_void_p])
isprojected = int_output(lgdal.OSRIsProjected, [c_void_p])
# Coordinate transformation
-new_ct= srs_output(std_call('OCTNewCoordinateTransformation'), [c_void_p, c_void_p])
+new_ct = srs_output(std_call('OCTNewCoordinateTransformation'), [c_void_p, c_void_p])
destroy_ct = void_output(std_call('OCTDestroyCoordinateTransformation'), [c_void_p], errcheck=False)
diff --git a/django/contrib/gis/geos/linestring.py b/django/contrib/gis/geos/linestring.py
index 5346ee6cec..0182646fa0 100644
--- a/django/contrib/gis/geos/linestring.py
+++ b/django/contrib/gis/geos/linestring.py
@@ -58,7 +58,7 @@ class LineString(GEOSGeometry):
# Creating a coordinate sequence object because it is easier to
# set the points using GEOSCoordSeq.__setitem__().
- cs = GEOSCoordSeq(capi.create_cs(ncoords, ndim), z=bool(ndim==3))
+ cs = GEOSCoordSeq(capi.create_cs(ncoords, ndim), z=bool(ndim == 3))
for i in xrange(ncoords):
if numpy_coords:
diff --git a/django/contrib/gis/geos/prototypes/prepared.py b/django/contrib/gis/geos/prototypes/prepared.py
index 7342d7d966..ff46979de3 100644
--- a/django/contrib/gis/geos/prototypes/prepared.py
+++ b/django/contrib/gis/geos/prototypes/prepared.py
@@ -14,7 +14,7 @@ prepared_destroy.restype = None
# Prepared geometry binary predicate support.
def prepared_predicate(func):
- func.argtypes= [PREPGEOM_PTR, GEOM_PTR]
+ func.argtypes = [PREPGEOM_PTR, GEOM_PTR]
func.restype = c_char
func.errcheck = check_predicate
return func
diff --git a/django/contrib/gis/maps/google/gmap.py b/django/contrib/gis/maps/google/gmap.py
index 4fe9b1198a..89b625378d 100644
--- a/django/contrib/gis/maps/google/gmap.py
+++ b/django/contrib/gis/maps/google/gmap.py
@@ -12,7 +12,7 @@ class GoogleMapException(Exception):
# The default Google Maps URL (for the API javascript)
# TODO: Internationalize for Japan, UK, etc.
-GOOGLE_MAPS_URL='http://maps.google.com/maps?file=api&v=%s&key='
+GOOGLE_MAPS_URL = 'http://maps.google.com/maps?file=api&v=%s&key='
class GoogleMap(object):
diff --git a/django/contrib/gis/maps/google/overlays.py b/django/contrib/gis/maps/google/overlays.py
index 0869f657a9..6b201cd4e5 100644
--- a/django/contrib/gis/maps/google/overlays.py
+++ b/django/contrib/gis/maps/google/overlays.py
@@ -52,7 +52,7 @@ class GEvent(object):
def __str__(self):
"Returns the parameter part of a GEvent."
- return mark_safe('"%s", %s' %(self.event, self.action))
+ return mark_safe('"%s", %s' % (self.event, self.action))
@python_2_unicode_compatible
class GOverlayBase(object):
@@ -303,7 +303,7 @@ class GMarker(GOverlayBase):
super(GMarker, self).__init__()
def latlng_from_coords(self, coords):
- return 'new GLatLng(%s,%s)' %(coords[1], coords[0])
+ return 'new GLatLng(%s,%s)' % (coords[1], coords[0])
def options(self):
result = []
diff --git a/django/contrib/gis/maps/google/zoom.py b/django/contrib/gis/maps/google/zoom.py
index 0e702c9905..f4e8a8ec7c 100644
--- a/django/contrib/gis/maps/google/zoom.py
+++ b/django/contrib/gis/maps/google/zoom.py
@@ -95,7 +95,7 @@ class GoogleZoom(object):
lon = (px[0] - npix) / self._degpp[zoom]
# Calculating the latitude value.
- lat = RTOD * (2 * atan(exp((px[1] - npix)/ (-1.0 * self._radpp[zoom]))) - 0.5 * pi)
+ lat = RTOD * (2 * atan(exp((px[1] - npix) / (-1.0 * self._radpp[zoom]))) - 0.5 * pi)
# Returning the longitude, latitude coordinate pair.
return (lon, lat)
diff --git a/django/contrib/gis/tests/test_geoforms.py b/django/contrib/gis/tests/test_geoforms.py
index 7c2f67e551..bedf1e1568 100644
--- a/django/contrib/gis/tests/test_geoforms.py
+++ b/django/contrib/gis/tests/test_geoforms.py
@@ -163,7 +163,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertFalse(invalid.is_valid())
self.assertTrue('Invalid geometry value' in str(invalid.errors))
- for invalid in [geo for key, geo in self.geometries.items() if key!='point']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'point']:
self.assertFalse(PointForm(data={'p': invalid.wkt}).is_valid())
def test_multipointfield(self):
@@ -176,7 +176,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertMapWidget(form)
self.assertFalse(PointForm().is_valid())
- for invalid in [geo for key, geo in self.geometries.items() if key!='multipoint']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'multipoint']:
self.assertFalse(PointForm(data={'p': invalid.wkt}).is_valid())
def test_linestringfield(self):
@@ -189,7 +189,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertMapWidget(form)
self.assertFalse(LineStringForm().is_valid())
- for invalid in [geo for key, geo in self.geometries.items() if key!='linestring']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'linestring']:
self.assertFalse(LineStringForm(data={'p': invalid.wkt}).is_valid())
def test_multilinestringfield(self):
@@ -202,7 +202,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertMapWidget(form)
self.assertFalse(LineStringForm().is_valid())
- for invalid in [geo for key, geo in self.geometries.items() if key!='multilinestring']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'multilinestring']:
self.assertFalse(LineStringForm(data={'p': invalid.wkt}).is_valid())
def test_polygonfield(self):
@@ -215,7 +215,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertMapWidget(form)
self.assertFalse(PolygonForm().is_valid())
- for invalid in [geo for key, geo in self.geometries.items() if key!='polygon']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'polygon']:
self.assertFalse(PolygonForm(data={'p': invalid.wkt}).is_valid())
def test_multipolygonfield(self):
@@ -228,7 +228,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertMapWidget(form)
self.assertFalse(PolygonForm().is_valid())
- for invalid in [geo for key, geo in self.geometries.items() if key!='multipolygon']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'multipolygon']:
self.assertFalse(PolygonForm(data={'p': invalid.wkt}).is_valid())
def test_geometrycollectionfield(self):
@@ -241,7 +241,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertMapWidget(form)
self.assertFalse(GeometryForm().is_valid())
- for invalid in [geo for key, geo in self.geometries.items() if key!='geometrycollection']:
+ for invalid in [geo for key, geo in self.geometries.items() if key != 'geometrycollection']:
self.assertFalse(GeometryForm(data={'g': invalid.wkt}).is_valid())
def test_osm_widget(self):
diff --git a/django/contrib/gis/tests/test_measure.py b/django/contrib/gis/tests/test_measure.py
index 21870b6f0c..5e0db3f913 100644
--- a/django/contrib/gis/tests/test_measure.py
+++ b/django/contrib/gis/tests/test_measure.py
@@ -272,5 +272,5 @@ def suite():
def run(verbosity=2):
unittest.TextTestRunner(verbosity=verbosity).run(suite())
-if __name__=="__main__":
+if __name__ == "__main__":
run()
diff --git a/django/contrib/messages/tests/base.py b/django/contrib/messages/tests/base.py
index 5e3fba2553..b247362e1b 100644
--- a/django/contrib/messages/tests/base.py
+++ b/django/contrib/messages/tests/base.py
@@ -214,11 +214,11 @@ class BaseTests(object):
@override_settings(
INSTALLED_APPS=filter(
- lambda app:app!='django.contrib.messages', settings.INSTALLED_APPS),
+ lambda app: app != 'django.contrib.messages', settings.INSTALLED_APPS),
MIDDLEWARE_CLASSES=filter(
- lambda m:'MessageMiddleware' not in m, settings.MIDDLEWARE_CLASSES),
+ lambda m: 'MessageMiddleware' not in m, settings.MIDDLEWARE_CLASSES),
TEMPLATE_CONTEXT_PROCESSORS=filter(
- lambda p:'context_processors.messages' not in p,
+ lambda p: 'context_processors.messages' not in p,
settings.TEMPLATE_CONTEXT_PROCESSORS),
MESSAGE_LEVEL=constants.DEBUG
)
@@ -239,11 +239,11 @@ class BaseTests(object):
@override_settings(
INSTALLED_APPS=filter(
- lambda app:app!='django.contrib.messages', settings.INSTALLED_APPS),
+ lambda app: app != 'django.contrib.messages', settings.INSTALLED_APPS),
MIDDLEWARE_CLASSES=filter(
- lambda m:'MessageMiddleware' not in m, settings.MIDDLEWARE_CLASSES),
+ lambda m: 'MessageMiddleware' not in m, settings.MIDDLEWARE_CLASSES),
TEMPLATE_CONTEXT_PROCESSORS=filter(
- lambda p:'context_processors.messages' not in p,
+ lambda p: 'context_processors.messages' not in p,
settings.TEMPLATE_CONTEXT_PROCESSORS),
MESSAGE_LEVEL=constants.DEBUG
)
diff --git a/django/contrib/redirects/models.py b/django/contrib/redirects/models.py
index a0376b5578..b2257cf166 100644
--- a/django/contrib/redirects/models.py
+++ b/django/contrib/redirects/models.py
@@ -15,7 +15,7 @@ class Redirect(models.Model):
verbose_name = _('redirect')
verbose_name_plural = _('redirects')
db_table = 'django_redirect'
- unique_together=(('site', 'old_path'),)
+ unique_together = (('site', 'old_path'),)
ordering = ('old_path',)
def __str__(self):
diff --git a/django/contrib/sites/managers.py b/django/contrib/sites/managers.py
index 1cd2416377..ceaccc7ae5 100644
--- a/django/contrib/sites/managers.py
+++ b/django/contrib/sites/managers.py
@@ -29,7 +29,7 @@ class CurrentSiteManager(models.Manager):
try:
field = self.model._meta.get_field(self.__field_name)
if not isinstance(field, (models.ForeignKey, models.ManyToManyField)):
- raise TypeError("%s must be a ForeignKey or ManyToManyField." %self.__field_name)
+ raise TypeError("%s must be a ForeignKey or ManyToManyField." % self.__field_name)
except FieldDoesNotExist:
raise ValueError("%s couldn't find a field named %s in %s." %
(self.__class__.__name__, self.__field_name, self.model._meta.object_name))
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 120cff096b..6f837ae1e4 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -138,7 +138,7 @@ class TranslatableFile(object):
if msgs:
if is_templatized:
# Remove '.py' suffix
- if os.name =='nt':
+ if os.name == 'nt':
# Preserve '.\' prefix on Windows to respect gettext behavior
old = '#: ' + work_file
new = '#: ' + orig_file
diff --git a/django/dispatch/saferef.py b/django/dispatch/saferef.py
index 41756a1001..7c971e44f7 100644
--- a/django/dispatch/saferef.py
+++ b/django/dispatch/saferef.py
@@ -83,7 +83,7 @@ class BoundMethodWeakref(object):
of already-referenced methods.
"""
key = cls.calculateKey(target)
- current =cls._allInstances.get(key)
+ current = cls._allInstances.get(key)
if current is not None:
current.deletionMethods.append(onDelete)
return current
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index e6f10dd37b..faee6381a2 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -274,7 +274,7 @@ class PasswordInput(TextInput):
def render(self, name, value, attrs=None):
if not self.render_value:
- value=None
+ value = None
return super(PasswordInput, self).render(name, value, attrs)
class HiddenInput(Input):
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
index d73f4aa546..e5fe4a776a 100644
--- a/django/utils/datastructures.py
+++ b/django/utils/datastructures.py
@@ -500,7 +500,7 @@ class ImmutableList(tuple):
extend = complain
insert = complain
pop = complain
- remove= complain
+ remove = complain
sort = complain
reverse = complain
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py
index 3c235d9867..2fe6760a88 100644
--- a/django/utils/dateformat.py
+++ b/django/utils/dateformat.py
@@ -170,7 +170,7 @@ class TimeFormat(Formatter):
def u(self):
"Microseconds; i.e. '000000' to '999999'"
- return '%06d' %self.data.microsecond
+ return '%06d' % self.data.microsecond
def Z(self):
"""
diff --git a/django/utils/datetime_safe.py b/django/utils/datetime_safe.py
index ca96fb37b0..286b5f127b 100644
--- a/django/utils/datetime_safe.py
+++ b/django/utils/datetime_safe.py
@@ -54,7 +54,7 @@ def _findall(text, substr):
if j == -1:
break
sites.append(j)
- i=j+1
+ i = j + 1
return sites
def strftime(dt, fmt):