Permalink
Browse files

Fixed all the E203 violations

  • Loading branch information...
1 parent 3351e94 commit b35ff0d9208c426cc0f67c65d724972974734f57 @alex alex committed Oct 27, 2013
Showing with 541 additions and 541 deletions.
  1. +1 −1 django/contrib/admin/templatetags/admin_list.py
  2. +9 −9 django/contrib/admindocs/utils.py
  3. +10 −10 django/contrib/admindocs/views.py
  4. +33 −33 django/contrib/gis/admin/options.py
  5. +1 −1 django/contrib/gis/admin/widgets.py
  6. +18 −18 django/contrib/gis/db/backends/oracle/operations.py
  7. +2 −2 django/contrib/gis/db/backends/postgis/introspection.py
  8. +32 −32 django/contrib/gis/db/backends/postgis/operations.py
  9. +7 −7 django/contrib/gis/db/backends/spatialite/introspection.py
  10. +18 −18 django/contrib/gis/db/backends/spatialite/operations.py
  11. +8 −8 django/contrib/gis/db/backends/utils.py
  12. +3 −3 django/contrib/gis/db/models/fields.py
  13. +52 −52 django/contrib/gis/db/models/query.py
  14. +2 −2 django/contrib/gis/db/models/sql/query.py
  15. +2 −2 django/contrib/gis/feeds.py
  16. +4 −4 django/contrib/gis/forms/fields.py
  17. +5 −5 django/contrib/gis/gdal/driver.py
  18. +14 −14 django/contrib/gis/gdal/geometries.py
  19. +13 −13 django/contrib/gis/gdal/geomtype.py
  20. +4 −4 django/contrib/gis/gdal/tests/test_driver.py
  21. +2 −2 django/contrib/gis/geoip/base.py
  22. +2 −2 django/contrib/gis/geoip/tests.py
  23. +8 −8 django/contrib/gis/geos/geometry.py
  24. +1 −1 django/contrib/gis/geos/tests/test_geos.py
  25. +3 −3 django/contrib/gis/management/commands/ogrinspect.py
  26. +13 −13 django/contrib/gis/maps/google/gmap.py
  27. +59 −59 django/contrib/gis/measure.py
  28. +2 −2 django/contrib/gis/sitemaps/kml.py
  29. +1 −1 django/contrib/gis/sitemaps/views.py
  30. +6 −6 django/contrib/gis/tests/geo3d/tests.py
  31. +7 −7 django/contrib/gis/tests/geoapp/feeds.py
  32. +3 −3 django/contrib/gis/tests/geoapp/sitemaps.py
  33. +4 −4 django/contrib/gis/tests/geoapp/test_regress.py
  34. +5 −5 django/contrib/gis/tests/geoapp/tests.py
  35. +2 −2 django/contrib/gis/tests/geoapp/urls.py
  36. +3 −3 django/contrib/gis/tests/geogapp/tests.py
  37. +13 −13 django/contrib/gis/tests/layermap/models.py
  38. +6 −6 django/contrib/gis/tests/layermap/tests.py
  39. +18 −18 django/contrib/gis/tests/test_spatialrefsys.py
  40. +22 −22 django/contrib/gis/utils/layermapping.py
  41. +4 −4 django/contrib/gis/utils/srs.py
  42. +1 −1 django/contrib/sites/management.py
  43. +6 −6 django/core/serializers/__init__.py
  44. +7 −7 django/core/serializers/xml_serializer.py
  45. +1 −1 django/core/urlresolvers.py
  46. +2 −2 django/forms/formsets.py
  47. +1 −1 django/test/html.py
  48. +1 −1 django/utils/translation/trans_real.py
  49. +3 −3 django/views/debug.py
  50. +3 −3 django/views/static.py
  51. +1 −1 docs/_ext/literals_to_xrefs.py
  52. +1 −1 setup.cfg
  53. +4 −4 tests/admin_views/admin.py
  54. +8 −8 tests/aggregation_regress/tests.py
  55. +26 −26 tests/cache/tests.py
  56. +5 −5 tests/forms_tests/tests/test_forms.py
  57. +3 −3 tests/model_forms/tests.py
  58. +1 −1 tests/serializers/tests.py
  59. +26 −26 tests/template_tests/filters.py
  60. +10 −10 tests/template_tests/templatetags/custom.py
  61. +6 −6 tests/template_tests/tests.py
  62. +2 −2 tests/test_client/views.py
  63. +1 −1 tests/test_utils/tests.py
@@ -398,7 +398,7 @@ def admin_list_filter(cl, spec):
tpl = get_template(spec.template)
return tpl.render(Context({
'title': spec.title,
- 'choices' : list(spec.choices(cl)),
+ 'choices': list(spec.choices(cl)),
'spec': spec,
}))
@@ -60,10 +60,10 @@ def parse_rst(text, default_reference_context, thing_being_parsed=None):
Convert the string from reST to an XHTML fragment.
"""
overrides = {
- 'doctitle_xform' : True,
- 'inital_header_level' : 3,
- "default_reference_context" : default_reference_context,
- "link_base" : reverse('django-admindocs-docroot').rstrip('/')
+ 'doctitle_xform': True,
+ 'inital_header_level': 3,
+ "default_reference_context": default_reference_context,
+ "link_base": reverse('django-admindocs-docroot').rstrip('/')
}
if thing_being_parsed:
thing_being_parsed = force_bytes("<%s>" % thing_being_parsed)
@@ -85,11 +85,11 @@ def parse_rst(text, default_reference_context, thing_being_parsed=None):
# reST roles
#
ROLES = {
- 'model' : '%s/models/%s/',
- 'view' : '%s/views/%s/',
- 'template' : '%s/templates/%s/',
- 'filter' : '%s/filters/#%s',
- 'tag' : '%s/tags/#%s',
+ 'model': '%s/models/%s/',
+ 'view': '%s/views/%s/',
+ 'template': '%s/templates/%s/',
+ 'filter': '%s/filters/#%s',
+ 'tag': '%s/tags/#%s',
}
def create_reference_role(rolename, urlbase):
@@ -229,12 +229,12 @@ def model_detail(request, app_label, model_name):
fields.append({
'name': "%s.all" % field.name,
"data_type": 'List',
- 'verbose': utils.parse_rst(_("all %s") % verbose , 'model', _('model:') + opts.model_name),
+ 'verbose': utils.parse_rst(_("all %s") % verbose, 'model', _('model:') + opts.model_name),
})
fields.append({
- 'name' : "%s.count" % field.name,
- 'data_type' : 'Integer',
- 'verbose' : utils.parse_rst(_("number of %s") % verbose , 'model', _('model:') + opts.model_name),
+ 'name': "%s.count" % field.name,
+ 'data_type': 'Integer',
+ 'verbose': utils.parse_rst(_("number of %s") % verbose, 'model', _('model:') + opts.model_name),
})
# Gather model methods.
@@ -260,14 +260,14 @@ def model_detail(request, app_label, model_name):
verbose = _("related `%(app_label)s.%(object_name)s` objects") % {'app_label': rel.opts.app_label, 'object_name': rel.opts.object_name}
accessor = rel.get_accessor_name()
fields.append({
- 'name' : "%s.all" % accessor,
- 'data_type' : 'List',
- 'verbose' : utils.parse_rst(_("all %s") % verbose , 'model', _('model:') + opts.model_name),
+ 'name': "%s.all" % accessor,
+ 'data_type': 'List',
+ 'verbose': utils.parse_rst(_("all %s") % verbose, 'model', _('model:') + opts.model_name),
})
fields.append({
- 'name' : "%s.count" % accessor,
- 'data_type' : 'Integer',
- 'verbose' : utils.parse_rst(_("number of %s") % verbose , 'model', _('model:') + opts.model_name),
+ 'name': "%s.count" % accessor,
+ 'data_type': 'Integer',
+ 'verbose': utils.parse_rst(_("number of %s") % verbose, 'model', _('model:') + opts.model_name),
})
return render_to_response('admin_doc/model_detail.html', {
'root_path': urlresolvers.reverse('admin:index'),
@@ -86,39 +86,39 @@ class OLMap(self.widget):
wms_options = ["%s: '%s'" % pair for pair in self.wms_options.items()]
wms_options = ', %s' % ', '.join(wms_options)
- params = {'default_lon' : self.default_lon,
- 'default_lat' : self.default_lat,
- 'default_zoom' : self.default_zoom,
- 'display_wkt' : self.debug or self.display_wkt,
- 'geom_type' : OGRGeomType(db_field.geom_type),
- 'field_name' : db_field.name,
- 'is_collection' : is_collection,
- 'scrollable' : self.scrollable,
- 'layerswitcher' : self.layerswitcher,
- 'collection_type' : collection_type,
- 'is_generic' : db_field.geom_type == 'GEOMETRY',
- 'is_linestring' : db_field.geom_type in ('LINESTRING', 'MULTILINESTRING'),
- 'is_polygon' : db_field.geom_type in ('POLYGON', 'MULTIPOLYGON'),
- 'is_point' : db_field.geom_type in ('POINT', 'MULTIPOINT'),
- 'num_zoom' : self.num_zoom,
- 'max_zoom' : self.max_zoom,
- 'min_zoom' : self.min_zoom,
- 'units' : self.units, # likely should get from object
- 'max_resolution' : self.max_resolution,
- 'max_extent' : self.max_extent,
- 'modifiable' : self.modifiable,
- 'mouse_position' : self.mouse_position,
- 'scale_text' : self.scale_text,
- 'map_width' : self.map_width,
- 'map_height' : self.map_height,
- 'point_zoom' : self.point_zoom,
- 'srid' : self.map_srid,
- 'display_srid' : self.display_srid,
- 'wms_url' : self.wms_url,
- 'wms_layer' : self.wms_layer,
- 'wms_name' : self.wms_name,
- 'wms_options' : wms_options,
- 'debug' : self.debug,
+ params = {'default_lon': self.default_lon,
+ 'default_lat': self.default_lat,
+ 'default_zoom': self.default_zoom,
+ 'display_wkt': self.debug or self.display_wkt,
+ 'geom_type': OGRGeomType(db_field.geom_type),
+ 'field_name': db_field.name,
+ 'is_collection': is_collection,
+ 'scrollable': self.scrollable,
+ 'layerswitcher': self.layerswitcher,
+ 'collection_type': collection_type,
+ 'is_generic': db_field.geom_type == 'GEOMETRY',
+ 'is_linestring': db_field.geom_type in ('LINESTRING', 'MULTILINESTRING'),
+ 'is_polygon': db_field.geom_type in ('POLYGON', 'MULTIPOLYGON'),
+ 'is_point': db_field.geom_type in ('POINT', 'MULTIPOINT'),
+ 'num_zoom': self.num_zoom,
+ 'max_zoom': self.max_zoom,
+ 'min_zoom': self.min_zoom,
+ 'units': self.units, # likely should get from object
+ 'max_resolution': self.max_resolution,
+ 'max_extent': self.max_extent,
+ 'modifiable': self.modifiable,
+ 'mouse_position': self.mouse_position,
+ 'scale_text': self.scale_text,
+ 'map_width': self.map_width,
+ 'map_height': self.map_height,
+ 'point_zoom': self.point_zoom,
+ 'srid': self.map_srid,
+ 'display_srid': self.display_srid,
+ 'wms_url': self.wms_url,
+ 'wms_layer': self.wms_layer,
+ 'wms_name': self.wms_name,
+ 'wms_options': wms_options,
+ 'debug': self.debug,
}
return OLMap
@@ -10,7 +10,7 @@
# Creating a template context that contains Django settings
# values needed by admin map templates.
-geo_context = Context({'LANGUAGE_BIDI' : translation.get_language_bidi()})
+geo_context = Context({'LANGUAGE_BIDI': translation.get_language_bidi()})
logger = logging.getLogger('django.contrib.gis')
@@ -109,33 +109,33 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
select = 'SDO_UTIL.TO_WKTGEOMETRY(%s)'
distance_functions = {
- 'distance_gt' : (SDODistance('>'), dtypes),
- 'distance_gte' : (SDODistance('>='), dtypes),
- 'distance_lt' : (SDODistance('<'), dtypes),
- 'distance_lte' : (SDODistance('<='), dtypes),
- 'dwithin' : (SDODWithin(), dtypes),
+ 'distance_gt': (SDODistance('>'), dtypes),
+ 'distance_gte': (SDODistance('>='), dtypes),
+ 'distance_lt': (SDODistance('<'), dtypes),
+ 'distance_lte': (SDODistance('<='), dtypes),
+ 'dwithin': (SDODWithin(), dtypes),
}
geometry_functions = {
- 'contains' : SDOOperation('SDO_CONTAINS'),
- 'coveredby' : SDOOperation('SDO_COVEREDBY'),
- 'covers' : SDOOperation('SDO_COVERS'),
- 'disjoint' : SDOGeomRelate('DISJOINT'),
- 'intersects' : SDOOperation('SDO_OVERLAPBDYINTERSECT'), # TODO: Is this really the same as ST_Intersects()?
- 'equals' : SDOOperation('SDO_EQUAL'),
- 'exact' : SDOOperation('SDO_EQUAL'),
- 'overlaps' : SDOOperation('SDO_OVERLAPS'),
- 'same_as' : SDOOperation('SDO_EQUAL'),
- 'relate' : (SDORelate, six.string_types), # Oracle uses a different syntax, e.g., 'mask=inside+touch'
- 'touches' : SDOOperation('SDO_TOUCH'),
- 'within' : SDOOperation('SDO_INSIDE'),
+ 'contains': SDOOperation('SDO_CONTAINS'),
+ 'coveredby': SDOOperation('SDO_COVEREDBY'),
+ 'covers': SDOOperation('SDO_COVERS'),
+ 'disjoint': SDOGeomRelate('DISJOINT'),
+ 'intersects': SDOOperation('SDO_OVERLAPBDYINTERSECT'), # TODO: Is this really the same as ST_Intersects()?
+ 'equals': SDOOperation('SDO_EQUAL'),
+ 'exact': SDOOperation('SDO_EQUAL'),
+ 'overlaps': SDOOperation('SDO_OVERLAPS'),
+ 'same_as': SDOOperation('SDO_EQUAL'),
+ 'relate': (SDORelate, six.string_types), # Oracle uses a different syntax, e.g., 'mask=inside+touch'
+ 'touches': SDOOperation('SDO_TOUCH'),
+ 'within': SDOOperation('SDO_INSIDE'),
}
geometry_functions.update(distance_functions)
gis_terms = set(['isnull'])
gis_terms.update(geometry_functions)
- truncate_params = {'relate' : None}
+ truncate_params = {'relate': None}
def convert_extent(self, clob):
if clob:
@@ -32,14 +32,14 @@ def get_postgis_types(self):
try:
cursor.execute(oid_sql, ('geometry',))
GEOM_TYPE = cursor.fetchone()[0]
- postgis_types = {GEOM_TYPE : 'GeometryField'}
+ postgis_types = {GEOM_TYPE: 'GeometryField'}
if self.connection.ops.geography:
cursor.execute(oid_sql, ('geography',))
GEOG_TYPE = cursor.fetchone()[0]
# The value for the geography type is actually a tuple
# to pass in the `geography=True` keyword to the field
# definition.
- postgis_types[GEOG_TYPE] = ('GeometryField', {'geography' : True})
+ postgis_types[GEOG_TYPE] = ('GeometryField', {'geography': True})
finally:
cursor.close()
@@ -84,73 +84,73 @@ def __init__(self, connection):
self.geometry_operators = {
# The "&<" operator returns true if A's bounding box overlaps or
# is to the left of B's bounding box.
- 'overlaps_left' : PostGISOperator('&<'),
+ 'overlaps_left': PostGISOperator('&<'),
# The "&>" operator returns true if A's bounding box overlaps or
# is to the right of B's bounding box.
- 'overlaps_right' : PostGISOperator('&>'),
+ 'overlaps_right': PostGISOperator('&>'),
# The "<<" operator returns true if A's bounding box is strictly
# to the left of B's bounding box.
- 'left' : PostGISOperator('<<'),
+ 'left': PostGISOperator('<<'),
# The ">>" operator returns true if A's bounding box is strictly
# to the right of B's bounding box.
- 'right' : PostGISOperator('>>'),
+ 'right': PostGISOperator('>>'),
# The "&<|" operator returns true if A's bounding box overlaps or
# is below B's bounding box.
- 'overlaps_below' : PostGISOperator('&<|'),
+ 'overlaps_below': PostGISOperator('&<|'),
# The "|&>" operator returns true if A's bounding box overlaps or
# is above B's bounding box.
- 'overlaps_above' : PostGISOperator('|&>'),
+ 'overlaps_above': PostGISOperator('|&>'),
# The "<<|" operator returns true if A's bounding box is strictly
# below B's bounding box.
- 'strictly_below' : PostGISOperator('<<|'),
+ 'strictly_below': PostGISOperator('<<|'),
# The "|>>" operator returns true if A's bounding box is strictly
# above B's bounding box.
- 'strictly_above' : PostGISOperator('|>>'),
+ 'strictly_above': PostGISOperator('|>>'),
# The "~=" operator is the "same as" operator. It tests actual
# geometric equality of two features. So if A and B are the same feature,
# vertex-by-vertex, the operator returns true.
- 'same_as' : PostGISOperator('~='),
- 'exact' : PostGISOperator('~='),
+ 'same_as': PostGISOperator('~='),
+ 'exact': PostGISOperator('~='),
# The "@" operator returns true if A's bounding box is completely contained
# by B's bounding box.
- 'contained' : PostGISOperator('@'),
+ 'contained': PostGISOperator('@'),
# The "~" operator returns true if A's bounding box completely contains
# by B's bounding box.
- 'bbcontains' : PostGISOperator('~'),
+ 'bbcontains': PostGISOperator('~'),
# The "&&" operator returns true if A's bounding box overlaps
# B's bounding box.
- 'bboverlaps' : PostGISOperator('&&'),
+ 'bboverlaps': PostGISOperator('&&'),
}
self.geometry_functions = {
- 'equals' : PostGISFunction(prefix, 'Equals'),
- 'disjoint' : PostGISFunction(prefix, 'Disjoint'),
- 'touches' : PostGISFunction(prefix, 'Touches'),
- 'crosses' : PostGISFunction(prefix, 'Crosses'),
- 'within' : PostGISFunction(prefix, 'Within'),
- 'overlaps' : PostGISFunction(prefix, 'Overlaps'),
- 'contains' : PostGISFunction(prefix, 'Contains'),
- 'intersects' : PostGISFunction(prefix, 'Intersects'),
- 'relate' : (PostGISRelate, six.string_types),
- 'coveredby' : PostGISFunction(prefix, 'CoveredBy'),
- 'covers' : PostGISFunction(prefix, 'Covers'),
+ 'equals': PostGISFunction(prefix, 'Equals'),
+ 'disjoint': PostGISFunction(prefix, 'Disjoint'),
+ 'touches': PostGISFunction(prefix, 'Touches'),
+ 'crosses': PostGISFunction(prefix, 'Crosses'),
+ 'within': PostGISFunction(prefix, 'Within'),
+ 'overlaps': PostGISFunction(prefix, 'Overlaps'),
+ 'contains': PostGISFunction(prefix, 'Contains'),
+ 'intersects': PostGISFunction(prefix, 'Intersects'),
+ 'relate': (PostGISRelate, six.string_types),
+ 'coveredby': PostGISFunction(prefix, 'CoveredBy'),
+ 'covers': PostGISFunction(prefix, 'Covers'),
}
# Valid distance types and substitutions
dtypes = (Decimal, Distance, float) + six.integer_types
def get_dist_ops(operator):
"Returns operations for both regular and spherical distances."
- return {'cartesian' : PostGISDistance(prefix, operator),
- 'sphere' : PostGISSphereDistance(prefix, operator),
- 'spheroid' : PostGISSpheroidDistance(prefix, operator),
+ return {'cartesian': PostGISDistance(prefix, operator),
+ 'sphere': PostGISSphereDistance(prefix, operator),
+ 'spheroid': PostGISSpheroidDistance(prefix, operator),
}
self.distance_functions = {
- 'distance_gt' : (get_dist_ops('>'), dtypes),
- 'distance_gte' : (get_dist_ops('>='), dtypes),
- 'distance_lt' : (get_dist_ops('<'), dtypes),
- 'distance_lte' : (get_dist_ops('<='), dtypes),
- 'dwithin' : (PostGISFunctionParam(prefix, 'DWithin'), dtypes)
+ 'distance_gt': (get_dist_ops('>'), dtypes),
+ 'distance_gte': (get_dist_ops('>='), dtypes),
+ 'distance_lt': (get_dist_ops('<'), dtypes),
+ 'distance_lte': (get_dist_ops('<='), dtypes),
+ 'dwithin': (PostGISFunctionParam(prefix, 'DWithin'), dtypes)
}
# Adding the distance functions to the geometries lookup.
@@ -9,13 +9,13 @@ class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
base_data_types_reverse = FlexibleFieldLookupDict.base_data_types_reverse.copy()
base_data_types_reverse.update(
- {'point' : 'GeometryField',
- 'linestring' : 'GeometryField',
- 'polygon' : 'GeometryField',
- 'multipoint' : 'GeometryField',
- 'multilinestring' : 'GeometryField',
- 'multipolygon' : 'GeometryField',
- 'geometrycollection' : 'GeometryField',
+ {'point': 'GeometryField',
+ 'linestring': 'GeometryField',
+ 'polygon': 'GeometryField',
+ 'multipoint': 'GeometryField',
+ 'multilinestring': 'GeometryField',
+ 'multipolygon': 'GeometryField',
+ 'geometrycollection': 'GeometryField',
})
class SpatiaLiteIntrospection(DatabaseIntrospection):
Oops, something went wrong. Retry.

0 comments on commit b35ff0d

Please sign in to comment.