summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Anderson <cmawebsite@gmail.com>2015-02-05 13:25:34 -0500
committerTim Graham <timograham@gmail.com>2015-02-06 09:35:08 -0500
commitfc8e1e0c107fe5fc8c82f01dfabfa9b7a196a67c (patch)
tree2479a9a9fdc399e9ec6d640d9eaca191e66e6c6c
parent232a1d297c8431a77f3dbb9bcf453d17eb5e3315 (diff)
[1.8.x] Fixed E265 comment style
Backport of db77915c9fd35a203edd8206f702ee4082f04d4a from master
-rw-r--r--django/apps/registry.py2
-rw-r--r--django/contrib/gis/db/models/fields.py4
-rw-r--r--django/contrib/gis/db/models/query.py4
-rw-r--r--django/contrib/gis/feeds.py4
-rw-r--r--django/contrib/gis/gdal/datasource.py1
-rw-r--r--django/contrib/gis/gdal/error.py4
-rw-r--r--django/contrib/gis/gdal/feature.py5
-rw-r--r--django/contrib/gis/gdal/field.py7
-rw-r--r--django/contrib/gis/gdal/geometries.py14
-rw-r--r--django/contrib/gis/gdal/layer.py5
-rw-r--r--django/contrib/gis/gdal/libgdal.py2
-rw-r--r--django/contrib/gis/gdal/prototypes/ds.py12
-rw-r--r--django/contrib/gis/gdal/prototypes/errcheck.py12
-rw-r--r--django/contrib/gis/gdal/prototypes/geom.py4
-rw-r--r--django/contrib/gis/gdal/prototypes/raster.py8
-rw-r--r--django/contrib/gis/gdal/prototypes/srs.py2
-rw-r--r--django/contrib/gis/gdal/srs.py16
-rw-r--r--django/contrib/gis/gdal/tests/test_geom.py2
-rw-r--r--django/contrib/gis/geoip/base.py7
-rw-r--r--django/contrib/gis/geoip/prototypes.py4
-rw-r--r--django/contrib/gis/geos/collections.py2
-rw-r--r--django/contrib/gis/geos/coordseq.py9
-rw-r--r--django/contrib/gis/geos/geometry.py21
-rw-r--r--django/contrib/gis/geos/libgeos.py2
-rw-r--r--django/contrib/gis/geos/linestring.py3
-rw-r--r--django/contrib/gis/geos/mutable_list.py12
-rw-r--r--django/contrib/gis/geos/point.py2
-rw-r--r--django/contrib/gis/geos/polygon.py4
-rw-r--r--django/contrib/gis/geos/prototypes/coordseq.py6
-rw-r--r--django/contrib/gis/geos/prototypes/errcheck.py1
-rw-r--r--django/contrib/gis/geos/prototypes/geom.py4
-rw-r--r--django/contrib/gis/geos/prototypes/io.py18
-rw-r--r--django/contrib/gis/geos/prototypes/misc.py4
-rw-r--r--django/contrib/gis/geos/prototypes/predicates.py6
-rw-r--r--django/contrib/gis/geos/prototypes/topology.py2
-rw-r--r--django/contrib/gis/geos/tests/test_geos.py14
-rw-r--r--django/contrib/gis/tests/geoapp/tests.py4
-rw-r--r--django/contrib/gis/utils/layermapping.py6
-rw-r--r--django/db/backends/base/base.py24
-rw-r--r--django/template/__init__.py4
-rw-r--r--docs/_ext/applyxrefs.py4
-rw-r--r--docs/conf.py86
-rw-r--r--setup.cfg2
-rw-r--r--tests/backends/tests.py14
-rw-r--r--tests/httpwrappers/tests.py2
-rw-r--r--tests/introspection/tests.py2
-rw-r--r--tests/migrations/test_commands.py2
-rw-r--r--tests/model_fields/models.py2
-rw-r--r--tests/model_forms/tests.py4
-rw-r--r--tests/model_regress/models.py4
-rw-r--r--tests/prefetch_related/models.py14
-rw-r--r--tests/serializers_regress/tests.py2
-rw-r--r--tests/syndication_tests/tests.py1
-rw-r--r--tests/urlpatterns_reverse/no_urls.py1
54 files changed, 197 insertions, 210 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 68aa411d91..efef0c9174 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -344,7 +344,7 @@ class Apps(object):
for model in self.get_models(include_auto_created=True):
model._meta._expire_cache()
- ### DEPRECATED METHODS GO BELOW THIS LINE ###
+ # ### DEPRECATED METHODS GO BELOW THIS LINE ###
def load_app(self, app_name):
"""
diff --git a/django/contrib/gis/db/models/fields.py b/django/contrib/gis/db/models/fields.py
index 5e70697a2b..acfb0915dd 100644
--- a/django/contrib/gis/db/models/fields.py
+++ b/django/contrib/gis/db/models/fields.py
@@ -163,7 +163,7 @@ class GeometryField(GeoSelectFormatMixin, Field):
self._get_srid_info(connection)
return self._units_name
- ### Routines specific to GeometryField ###
+ # ### Routines specific to GeometryField ###
def geodetic(self, connection):
"""
Returns true if this field's SRID corresponds with a coordinate
@@ -236,7 +236,7 @@ class GeometryField(GeoSelectFormatMixin, Field):
else:
return gsrid
- ### Routines overloaded from Field ###
+ # ### Routines overloaded from Field ###
def contribute_to_class(self, cls, name, **kwargs):
super(GeometryField, self).contribute_to_class(cls, name, **kwargs)
diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py
index c36381ecaa..6e231a8607 100644
--- a/django/contrib/gis/db/models/query.py
+++ b/django/contrib/gis/db/models/query.py
@@ -23,7 +23,7 @@ from django.utils.deprecation import RemovedInDjango20Warning
class GeoQuerySet(QuerySet):
"The Geographic QuerySet."
- ### GeoQuerySet Methods ###
+ # ### GeoQuerySet Methods ###
def area(self, tolerance=0.05, **kwargs):
"""
Returns the area of the geographic field in an `area` attribute on
@@ -428,7 +428,7 @@ class GeoQuerySet(QuerySet):
)
return self._spatial_aggregate(aggregates.Union, **kwargs)
- ### Private API -- Abstracted DRY routines. ###
+ # ### Private API -- Abstracted DRY routines. ###
def _spatial_setup(self, att, desc=None, field_name=None, geo_field_type=None):
"""
Performs set up for executing the spatial function.
diff --git a/django/contrib/gis/feeds.py b/django/contrib/gis/feeds.py
index 006b0298f4..fc66beec45 100644
--- a/django/contrib/gis/feeds.py
+++ b/django/contrib/gis/feeds.py
@@ -81,7 +81,7 @@ class GeoFeedMixin(object):
raise ValueError('Geometry type "%s" not supported.' % geom.geom_type)
-### SyndicationFeed subclasses ###
+# ### SyndicationFeed subclasses ###
class GeoRSSFeed(Rss201rev2Feed, GeoFeedMixin):
def rss_attributes(self):
attrs = super(GeoRSSFeed, self).rss_attributes()
@@ -127,7 +127,7 @@ class W3CGeoFeed(Rss201rev2Feed, GeoFeedMixin):
self.add_georss_element(handler, self.feed, w3c_geo=True)
-### Feed subclass ###
+# ### Feed subclass ###
class Feed(BaseFeed):
"""
This is a subclass of the `Feed` from `django.contrib.syndication`.
diff --git a/django/contrib/gis/gdal/datasource.py b/django/contrib/gis/gdal/datasource.py
index ec9ab8c2a4..7fa9d83e12 100644
--- a/django/contrib/gis/gdal/datasource.py
+++ b/django/contrib/gis/gdal/datasource.py
@@ -57,7 +57,6 @@ from django.utils.six.moves import range
class DataSource(GDALBase):
"Wraps an OGR Data Source object."
- #### Python 'magic' routines ####
def __init__(self, ds_input, ds_driver=False, write=False, encoding='utf-8'):
# The write flag.
if write:
diff --git a/django/contrib/gis/gdal/error.py b/django/contrib/gis/gdal/error.py
index e7269beca1..4dc0b71678 100644
--- a/django/contrib/gis/gdal/error.py
+++ b/django/contrib/gis/gdal/error.py
@@ -5,7 +5,7 @@
"""
-#### GDAL & SRS Exceptions ####
+# #### GDAL & SRS Exceptions ####
class GDALException(Exception):
pass
@@ -27,7 +27,7 @@ class OGRIndexError(GDALException, KeyError):
"""
silent_variable_failure = True
-#### GDAL/OGR error checking codes and routine ####
+# #### GDAL/OGR error checking codes and routine ####
# OGR Error Codes
OGRERR_DICT = {
diff --git a/django/contrib/gis/gdal/feature.py b/django/contrib/gis/gdal/feature.py
index da86c70244..b1a0b19fd0 100644
--- a/django/contrib/gis/gdal/feature.py
+++ b/django/contrib/gis/gdal/feature.py
@@ -22,7 +22,6 @@ class Feature(GDALBase):
from a Layer object.
"""
- #### Python 'magic' routines ####
def __init__(self, feat, layer):
"""
Initializes Feature from a pointer and its Layer object.
@@ -69,7 +68,7 @@ class Feature(GDALBase):
"Does equivalence testing on the features."
return bool(capi.feature_equal(self.ptr, other._ptr))
- #### Feature Properties ####
+ # #### Feature Properties ####
@property
def encoding(self):
return self._layer._ds.encoding
@@ -108,7 +107,7 @@ class Feature(GDALBase):
"Returns the OGR Geometry Type for this Feture."
return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn))
- #### Feature Methods ####
+ # #### Feature Methods ####
def get(self, field):
"""
Returns the value of the field, instead of an instance of the Field
diff --git a/django/contrib/gis/gdal/field.py b/django/contrib/gis/gdal/field.py
index 487c29ea42..fb77480fa1 100644
--- a/django/contrib/gis/gdal/field.py
+++ b/django/contrib/gis/gdal/field.py
@@ -16,7 +16,6 @@ class Field(GDALBase):
from a Feature object.
"""
- #### Python 'magic' routines ####
def __init__(self, feat, index):
"""
Initializes on the feature object and the integer index of
@@ -44,7 +43,7 @@ class Field(GDALBase):
"Returns the string representation of the Field."
return str(self.value).strip()
- #### Field Methods ####
+ # #### Field Methods ####
def as_double(self):
"Retrieves the Field's value as a double (float)."
return capi.get_field_as_double(self._feat.ptr, self._index)
@@ -69,7 +68,7 @@ class Field(GDALBase):
else:
raise GDALException('Unable to retrieve date & time information from the field.')
- #### Field Properties ####
+ # #### Field Properties ####
@property
def name(self):
"Returns the name of this Field."
@@ -103,7 +102,7 @@ class Field(GDALBase):
return capi.get_field_width(self.ptr)
-### The Field sub-classes for each OGR Field type. ###
+# ### The Field sub-classes for each OGR Field type. ###
class OFTInteger(Field):
_double = False
diff --git a/django/contrib/gis/gdal/geometries.py b/django/contrib/gis/gdal/geometries.py
index d00aa1a785..b984eea4ee 100644
--- a/django/contrib/gis/gdal/geometries.py
+++ b/django/contrib/gis/gdal/geometries.py
@@ -154,7 +154,7 @@ class OGRGeometry(GDALBase):
return OGRGeometry('POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' % (
x0, y0, x0, y1, x1, y1, x1, y0, x0, y0))
- ### Geometry set-like operations ###
+ # ### Geometry set-like operations ###
# g = g1 | g2
def __or__(self, other):
"Returns the union of the two geometries."
@@ -190,7 +190,7 @@ class OGRGeometry(GDALBase):
"WKT is used for the string representation."
return self.wkt
- #### Geometry Properties ####
+ # #### Geometry Properties ####
@property
def dimension(self):
"Returns 0 for points, 1 for lines, and 2 for surfaces."
@@ -254,7 +254,7 @@ class OGRGeometry(GDALBase):
"Returns the envelope as a 4-tuple, instead of as an Envelope object."
return self.envelope.tuple
- #### SpatialReference-related Properties ####
+ # #### SpatialReference-related Properties ####
# The SRS property
def _get_srs(self):
@@ -297,7 +297,7 @@ class OGRGeometry(GDALBase):
srid = property(_get_srid, _set_srid)
- #### Output Methods ####
+ # #### Output Methods ####
@property
def geos(self):
"Returns a GEOSGeometry object from this OGRGeometry."
@@ -360,7 +360,7 @@ class OGRGeometry(GDALBase):
else:
return self.wkt
- #### Geometry Methods ####
+ # #### Geometry Methods ####
def clone(self):
"Clones this OGR Geometry."
return OGRGeometry(capi.clone_geom(self.ptr), self.srs)
@@ -405,7 +405,7 @@ class OGRGeometry(GDALBase):
"For backwards-compatibility."
self.transform(srs)
- #### Topology Methods ####
+ # #### Topology Methods ####
def _topology(self, func, other):
"""A generalized function for topology operations, takes a GDAL function and
the other geometry to perform the operation on."""
@@ -448,7 +448,7 @@ class OGRGeometry(GDALBase):
"Returns True if this geometry overlaps the other."
return self._topology(capi.ogr_overlaps, other)
- #### Geometry-generation Methods ####
+ # #### Geometry-generation Methods ####
def _geomgen(self, gen_func, other=None):
"A helper routine for the OGR routines that generate geometries."
if isinstance(other, OGRGeometry):
diff --git a/django/contrib/gis/gdal/layer.py b/django/contrib/gis/gdal/layer.py
index e2627a2da9..b5c7307767 100644
--- a/django/contrib/gis/gdal/layer.py
+++ b/django/contrib/gis/gdal/layer.py
@@ -26,7 +26,6 @@ from django.utils.six.moves import range
class Layer(GDALBase):
"A class that wraps an OGR Layer, needs to be instantiated from a DataSource object."
- #### Python 'magic' routines ####
def __init__(self, layer_ptr, ds):
"""
Initializes on an OGR C pointer to the Layer and the `DataSource` object
@@ -95,7 +94,7 @@ class Layer(GDALBase):
# Should have returned a Feature, raise an OGRIndexError.
raise OGRIndexError('Invalid feature id: %s.' % feat_id)
- #### Layer properties ####
+ # #### Layer properties ####
@property
def extent(self):
"Returns the extent (an Envelope) of this layer."
@@ -189,7 +188,7 @@ class Layer(GDALBase):
spatial_filter = property(_get_spatial_filter, _set_spatial_filter)
- #### Layer Methods ####
+ # #### Layer Methods ####
def get_fields(self, field_name):
"""
Returns a list containing the given field name for every Feature
diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py
index 280ae2ef5b..fd9a9946a0 100644
--- a/django/contrib/gis/gdal/libgdal.py
+++ b/django/contrib/gis/gdal/libgdal.py
@@ -66,7 +66,7 @@ def std_call(func):
else:
return lgdal[func]
-#### Version-information functions. ####
+# #### Version-information functions. ####
# Returns GDAL library version information with the given key.
_version_info = std_call('GDALVersionInfo')
diff --git a/django/contrib/gis/gdal/prototypes/ds.py b/django/contrib/gis/gdal/prototypes/ds.py
index 69257a1140..1b24df4bf3 100644
--- a/django/contrib/gis/gdal/prototypes/ds.py
+++ b/django/contrib/gis/gdal/prototypes/ds.py
@@ -11,7 +11,7 @@ from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
c_int_p = POINTER(c_int) # shortcut type
-### Driver Routines ###
+# Driver Routines
register_all = void_output(lgdal.OGRRegisterAll, [], errcheck=False)
cleanup_all = void_output(lgdal.OGRCleanupAll, [], errcheck=False)
get_driver = voidptr_output(lgdal.OGRGetDriver, [c_int])
@@ -19,7 +19,7 @@ get_driver_by_name = voidptr_output(lgdal.OGRGetDriverByName, [c_char_p], errche
get_driver_count = int_output(lgdal.OGRGetDriverCount, [])
get_driver_name = const_string_output(lgdal.OGR_Dr_GetName, [c_void_p], decoding='ascii')
-### DataSource ###
+# DataSource
open_ds = voidptr_output(lgdal.OGROpen, [c_char_p, c_int, POINTER(c_void_p)])
destroy_ds = void_output(lgdal.OGR_DS_Destroy, [c_void_p], errcheck=False)
release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p])
@@ -28,7 +28,7 @@ get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int])
get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p])
get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p])
-### Layer Routines ###
+# Layer Routines
get_extent = void_output(lgdal.OGR_L_GetExtent, [c_void_p, POINTER(OGREnvelope), c_int])
get_feature = voidptr_output(lgdal.OGR_L_GetFeature, [c_void_p, c_long])
get_feature_count = int_output(lgdal.OGR_L_GetFeatureCount, [c_void_p, c_int])
@@ -43,14 +43,14 @@ set_spatial_filter_rect = void_output(lgdal.OGR_L_SetSpatialFilterRect,
[c_void_p, c_double, c_double, c_double, c_double], errcheck=False
)
-### Feature Definition Routines ###
+# Feature Definition Routines
get_fd_geom_type = int_output(lgdal.OGR_FD_GetGeomType, [c_void_p])
get_fd_name = const_string_output(lgdal.OGR_FD_GetName, [c_void_p])
get_feat_name = const_string_output(lgdal.OGR_FD_GetName, [c_void_p])
get_field_count = int_output(lgdal.OGR_FD_GetFieldCount, [c_void_p])
get_field_defn = voidptr_output(lgdal.OGR_FD_GetFieldDefn, [c_void_p, c_int])
-### Feature Routines ###
+# Feature Routines
clone_feature = voidptr_output(lgdal.OGR_F_Clone, [c_void_p])
destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck=False)
feature_equal = int_output(lgdal.OGR_F_Equal, [c_void_p, c_void_p])
@@ -66,7 +66,7 @@ get_field_as_integer = int_output(lgdal.OGR_F_GetFieldAsInteger, [c_void_p, c_in
get_field_as_string = const_string_output(lgdal.OGR_F_GetFieldAsString, [c_void_p, c_int])
get_field_index = int_output(lgdal.OGR_F_GetFieldIndex, [c_void_p, c_char_p])
-### Field Routines ###
+# Field Routines
get_field_name = const_string_output(lgdal.OGR_Fld_GetNameRef, [c_void_p])
get_field_precision = int_output(lgdal.OGR_Fld_GetPrecision, [c_void_p])
get_field_type = int_output(lgdal.OGR_Fld_GetType, [c_void_p])
diff --git a/django/contrib/gis/gdal/prototypes/errcheck.py b/django/contrib/gis/gdal/prototypes/errcheck.py
index d6c5ad17eb..2940079b03 100644
--- a/django/contrib/gis/gdal/prototypes/errcheck.py
+++ b/django/contrib/gis/gdal/prototypes/errcheck.py
@@ -21,7 +21,7 @@ def ptr_byref(args, offset=-1):
return args[offset]._obj
-### String checking Routines ###
+# ### String checking Routines ###
def check_const_string(result, func, cargs, offset=None, cpl=False):
"""
Similar functionality to `check_string`, but does not free the pointer.
@@ -62,17 +62,17 @@ def check_string(result, func, cargs, offset=-1, str_result=False):
lgdal.VSIFree(ptr)
return s
-### DataSource, Layer error-checking ###
+# ### DataSource, Layer error-checking ###
-### Envelope checking ###
+# ### Envelope checking ###
def check_envelope(result, func, cargs, offset=-1):
"Checks a function that returns an OGR Envelope by reference."
env = ptr_byref(cargs, offset)
return env
-### Geometry error-checking routines ###
+# ### Geometry error-checking routines ###
def check_geom(result, func, cargs):
"Checks a function that returns a geometry."
# OGR_G_Clone may return an integer, even though the
@@ -91,7 +91,7 @@ def check_geom_offset(result, func, cargs, offset=-1):
return check_geom(geom, func, cargs)
-### Spatial Reference error-checking routines ###
+# ### Spatial Reference error-checking routines ###
def check_srs(result, func, cargs):
if isinstance(result, six.integer_types):
result = c_void_p(result)
@@ -100,7 +100,7 @@ def check_srs(result, func, cargs):
return result
-### Other error-checking routines ###
+# ### Other error-checking routines ###
def check_arg_errcode(result, func, cargs, cpl=False):
"""
The error code is returned in the last argument, by reference.
diff --git a/django/contrib/gis/gdal/prototypes/geom.py b/django/contrib/gis/gdal/prototypes/geom.py
index 22ff1ed833..15f4d5b893 100644
--- a/django/contrib/gis/gdal/prototypes/geom.py
+++ b/django/contrib/gis/gdal/prototypes/geom.py
@@ -6,7 +6,7 @@ from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, geom_output, int_output, srs_output, string_output, void_output)
-### Generation routines specific to this module ###
+# ### Generation routines specific to this module ###
def env_func(f, argtypes):
"For getting OGREnvelopes."
f.argtypes = argtypes
@@ -26,7 +26,7 @@ def topology_func(f):
f.errchck = bool
return f
-### OGR_G ctypes function prototypes ###
+# ### OGR_G ctypes function prototypes ###
# GeoJSON routines.
from_json = geom_output(lgdal.OGR_G_CreateGeometryFromJson, [c_char_p])
diff --git a/django/contrib/gis/gdal/prototypes/raster.py b/django/contrib/gis/gdal/prototypes/raster.py
index db32ee1e0b..781c4ded89 100644
--- a/django/contrib/gis/gdal/prototypes/raster.py
+++ b/django/contrib/gis/gdal/prototypes/raster.py
@@ -18,14 +18,14 @@ void_output = partial(void_output, cpl=True)
const_string_output = partial(const_string_output, cpl=True)
double_output = partial(double_output, cpl=True)
-### Raster Driver Routines ###
+# Raster Driver Routines
register_all = void_output(lgdal.GDALAllRegister, [])
get_driver = voidptr_output(lgdal.GDALGetDriver, [c_int])
get_driver_by_name = voidptr_output(lgdal.GDALGetDriverByName, [c_char_p], errcheck=False)
get_driver_count = int_output(lgdal.GDALGetDriverCount, [])
get_driver_description = const_string_output(lgdal.GDALGetDescription, [c_void_p])
-### Raster Data Source Routines ###
+# Raster Data Source Routines
create_ds = voidptr_output(lgdal.GDALCreate, [c_void_p, c_char_p, c_int, c_int, c_int, c_int])
open_ds = voidptr_output(lgdal.GDALOpen, [c_char_p, c_int])
close_ds = void_output(lgdal.GDALClose, [c_void_p])
@@ -43,7 +43,7 @@ set_ds_projection_ref = void_output(lgdal.GDALSetProjection, [c_void_p, c_char_p
get_ds_geotransform = void_output(lgdal.GDALGetGeoTransform, [c_void_p, POINTER(c_double * 6)], errcheck=False)
set_ds_geotransform = void_output(lgdal.GDALSetGeoTransform, [c_void_p, POINTER(c_double * 6)])
-### Raster Band Routines ###
+# Raster Band Routines
band_io = void_output(lgdal.GDALRasterIO, [c_void_p, c_int, c_int, c_int, c_int, c_int,
c_void_p, c_int, c_int, c_int, c_int, c_int])
get_band_xsize = int_output(lgdal.GDALGetRasterBandXSize, [c_void_p])
@@ -57,7 +57,7 @@ set_band_nodata_value = void_output(lgdal.GDALSetRasterNoDataValue, [c_void_p, c
get_band_minimum = double_output(lgdal.GDALGetRasterMinimum, [c_void_p, POINTER(c_int)])
get_band_maximum = double_output(lgdal.GDALGetRasterMaximum, [c_void_p, POINTER(c_int)])
-### Reprojection routine ###
+# Reprojection routine
reproject_image = void_output(lgdal.GDALReprojectImage, [c_void_p, c_char_p, c_void_p, c_char_p,
c_int, c_double, c_double,
c_void_p, c_void_p, c_void_p])
diff --git a/django/contrib/gis/gdal/prototypes/srs.py b/django/contrib/gis/gdal/prototypes/srs.py
index 71ec1ed603..424853704d 100644
--- a/django/contrib/gis/gdal/prototypes/srs.py
+++ b/django/contrib/gis/gdal/prototypes/srs.py
@@ -4,7 +4,7 @@ from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, int_output, srs_output, string_output, void_output)
-## Shortcut generation for routines with known parameters.
+# Shortcut generation for routines with known parameters.
def srs_double(f):
"""
Creates a function prototype for the OSR routines that take
diff --git a/django/contrib/gis/gdal/srs.py b/django/contrib/gis/gdal/srs.py
index 8749d079b3..9450277275 100644
--- a/django/contrib/gis/gdal/srs.py
+++ b/django/contrib/gis/gdal/srs.py
@@ -37,7 +37,6 @@ from django.utils import six
from django.utils.encoding import force_bytes, force_text
-#### Spatial Reference class. ####
class SpatialReference(GDALBase):
"""
A wrapper for the OGRSpatialReference object. According to the GDAL Web site,
@@ -45,7 +44,6 @@ class SpatialReference(GDALBase):
systems (projections and datums) and to transform between them."
"""
- #### Python 'magic' routines ####
def __init__(self, srs_input='', srs_type='user'):
"""
Creates a GDAL OSR Spatial Reference object from the given input.
@@ -135,7 +133,7 @@ class SpatialReference(GDALBase):
"The string representation uses 'pretty' WKT."
return self.pretty_wkt
- #### SpatialReference Methods ####
+ # #### SpatialReference Methods ####
def attr_value(self, target, index=0):
"""
The attribute value for the given target node (e.g. 'PROJCS'). The index
@@ -176,7 +174,7 @@ class SpatialReference(GDALBase):
"Checks to see if the given spatial reference is valid."
capi.srs_validate(self.ptr)
- #### Name & SRID properties ####
+ # #### Name & SRID properties ####
@property
def name(self):
"Returns the name of this Spatial Reference."
@@ -197,7 +195,7 @@ class SpatialReference(GDALBase):
except (TypeError, ValueError):
return None
- #### Unit Properties ####
+ # #### Unit Properties ####
@property
def linear_name(self):
"Returns the name of the linear units."
@@ -238,7 +236,7 @@ class SpatialReference(GDALBase):
name = force_text(name)
return (units, name)
- #### Spheroid/Ellipsoid Properties ####
+ # #### Spheroid/Ellipsoid Properties ####
@property
def ellipsoid(self):
"""
@@ -262,7 +260,7 @@ class SpatialReference(GDALBase):
"Returns the Inverse Flattening for this Spatial Reference."
return capi.invflattening(self.ptr, byref(c_int()))
- #### Boolean Properties ####
+ # #### Boolean Properties ####
@property
def geographic(self):
"""
@@ -284,7 +282,7 @@ class SpatialReference(GDALBase):
"""
return bool(capi.isprojected(self.ptr))
- #### Import Routines #####
+ # #### Import Routines #####
def import_epsg(self, epsg):
"Imports the Spatial Reference from the EPSG code (an integer)."
capi.from_epsg(self.ptr, epsg)
@@ -305,7 +303,7 @@ class SpatialReference(GDALBase):
"Imports the Spatial Reference from an XML string."
capi.from_xml(self.ptr, xml)
- #### Export Properties ####
+ # #### Export Properties ####
@property
def wkt(self):
"Returns the WKT representation of this Spatial Reference."
diff --git a/django/contrib/gis/gdal/tests/test_geom.py b/django/contrib/gis/gdal/tests/test_geom.py
index 4f422c06f6..d0651fcaf2 100644
--- a/django/contrib/gis/gdal/tests/test_geom.py
+++ b/django/contrib/gis/gdal/tests/test_geom.py
@@ -196,7 +196,7 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin):
prev = OGRGeometry('POINT(0 0)')
for rr in self.geometries.linearrings:
lr = OGRGeometry(rr.wkt)
- #self.assertEqual(101, lr.geom_type.num)
+ # self.assertEqual(101, lr.geom_type.num)
self.assertEqual('LINEARRING', lr.geom_name)
self.assertEqual(rr.n_p, len(lr))
self.assertEqual(lr, OGRGeometry(rr.wkt))
diff --git a/django/contrib/gis/geoip/base.py b/django/contrib/gis/geoip/base.py
index 9409019d94..de0bfd18a7 100644
--- a/django/contrib/gis/geoip/base.py
+++ b/django/contrib/gis/geoip/base.py
@@ -18,7 +18,6 @@ free_regex = re.compile(r'^GEO-\d{3}FREE')
lite_regex = re.compile(r'^GEO-\d{3}LITE')
-#### GeoIP classes ####
class GeoIPException(Exception):
pass
@@ -201,7 +200,7 @@ class GeoIP(object):
'country_name': self.country_name(query),
}
- #### Coordinate retrieval routines ####
+ # #### Coordinate retrieval routines ####
def coords(self, query, ordering=('longitude', 'latitude')):
cdict = self.city(query)
if cdict is None:
@@ -226,7 +225,7 @@ class GeoIP(object):
else:
return None
- #### GeoIP Database Information Routines ####
+ # #### GeoIP Database Information Routines ####
@property
def country_info(self):
"Returns information about the GeoIP country database."
@@ -253,7 +252,7 @@ class GeoIP(object):
info += 'GeoIP Library:\n\t%s\n' % GeoIP_lib_version()
return info + 'Country:\n\t%s\nCity:\n\t%s' % (self.country_info, self.city_info)
- #### Methods for compatibility w/the GeoIP-Python API. ####
+ # #### Methods for compatibility w/the GeoIP-Python API. ####
@classmethod
def open(cls, full_path, cache):
return GeoIP(full_path, cache)
diff --git a/django/contrib/gis/geoip/prototypes.py b/django/contrib/gis/geoip/prototypes.py
index 22c17f006f..751b4c4b05 100644
--- a/django/contrib/gis/geoip/prototypes.py
+++ b/django/contrib/gis/geoip/prototypes.py
@@ -2,7 +2,7 @@ from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER
from django.contrib.gis.geoip.libgeoip import lgeoip, free
-#### GeoIP C Structure definitions ####
+# #### GeoIP C Structure definitions ####
class GeoIPRecord(Structure):
_fields_ = [('country_code', c_char_p),
@@ -36,7 +36,7 @@ class GeoIPTag(Structure):
RECTYPE = POINTER(GeoIPRecord)
DBTYPE = POINTER(GeoIPTag)
-#### ctypes function prototypes ####
+# #### ctypes function prototypes ####
# GeoIP_lib_version appeared in version 1.4.7.
if hasattr(lgeoip, 'GeoIP_lib_version'):
diff --git a/django/contrib/gis/geos/collections.py b/django/contrib/gis/geos/collections.py
index 83f57cbd18..82a2169ab0 100644
--- a/django/contrib/gis/geos/collections.py
+++ b/django/contrib/gis/geos/collections.py
@@ -49,7 +49,7 @@ class GeometryCollection(GEOSGeometry):
"Returns the number of geometries in this Collection."
return self.num_geom
- ### Methods for compatibility with ListMixin ###
+ # ### Methods for compatibility with ListMixin ###
def _create_collection(self, length, items):
# Creating the geometry pointer array.
geoms = get_pointer_arr(length)
diff --git a/django/contrib/gis/geos/coordseq.py b/django/contrib/gis/geos/coordseq.py
index c238d4cda5..d11c6fbde3 100644
--- a/django/contrib/gis/geos/coordseq.py
+++ b/django/contrib/gis/geos/coordseq.py
@@ -16,7 +16,6 @@ class GEOSCoordSeq(GEOSBase):
ptr_type = CS_PTR
- #### Python 'magic' routines ####
def __init__(self, ptr, z=False):
"Initializes from a GEOS pointer."
if not isinstance(ptr, CS_PTR):
@@ -68,7 +67,7 @@ class GEOSCoordSeq(GEOSBase):
if set_3d:
self.setZ(index, value[2])
- #### Internal Routines ####
+ # #### Internal Routines ####
def _checkindex(self, index):
"Checks the given index."
sz = self.size
@@ -80,7 +79,7 @@ class GEOSCoordSeq(GEOSBase):
if dim < 0 or dim > 2:
raise GEOSException('invalid ordinate dimension "%d"' % dim)
- #### Ordinate getting and setting routines ####
+ # #### Ordinate getting and setting routines ####
def getOrdinate(self, dimension, index):
"Returns the value for the given dimension and index."
self._checkindex(index)
@@ -117,7 +116,7 @@ class GEOSCoordSeq(GEOSBase):
"Set Z with the value at the given index."
self.setOrdinate(2, index, value)
- ### Dimensions ###
+ # ### Dimensions ###
@property
def size(self):
"Returns the size of this coordinate sequence."
@@ -136,7 +135,7 @@ class GEOSCoordSeq(GEOSBase):
"""
return self._z
- ### Other Methods ###
+ # ### Other Methods ###
def clone(self):
"Clones this coordinate sequence."
return GEOSCoordSeq(capi.cs_clone(self.ptr), self.hasz)
diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py
index c3ba634df1..dd110c0236 100644
--- a/django/contrib/gis/geos/geometry.py
+++ b/django/contrib/gis/geos/geometry.py
@@ -43,7 +43,6 @@ class GEOSGeometry(GEOSBase, ListMixin):
ptr_type = GEOM_PTR
- #### Python 'magic' routines ####
def __init__(self, geo_input, srid=None):
"""
The base constructor for GEOS geometry objects, and may take the
@@ -175,7 +174,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"The not equals operator."
return not (self == other)
- ### Geometry set-like operations ###
+ # ### Geometry set-like operations ###
# Thanks to Sean Gillies for inspiration:
# http://lists.gispython.org/pipermail/community/2007-July/001034.html
# g = g1 | g2
@@ -198,7 +197,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"Return the symmetric difference of this Geometry and the other."
return self.sym_difference(other)
- #### Coordinate Sequence Routines ####
+ # #### Coordinate Sequence Routines ####
@property
def has_cs(self):
"Returns True if this Geometry has a coordinate sequence, False if not."
@@ -221,7 +220,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
if self.has_cs:
return self._cs.clone()
- #### Geometry Info ####
+ # #### Geometry Info ####
@property
def geom_type(self):
"Returns a string representing the Geometry type, e.g. 'Polygon'"
@@ -256,7 +255,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"Converts this Geometry to normal form (or canonical form)."
return capi.geos_normalize(self.ptr)
- #### Unary predicates ####
+ # #### Unary predicates ####
@property
def empty(self):
"""
@@ -292,7 +291,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"""
return capi.geos_isvalidreason(self.ptr).decode()
- #### Binary predicates. ####
+ # #### Binary predicates. ####
def contains(self, other):
"Returns true if other.within(this) returns true."
return capi.geos_contains(self.ptr, other.ptr)
@@ -360,7 +359,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"""
return capi.geos_within(self.ptr, other.ptr)
- #### SRID Routines ####
+ # #### SRID Routines ####
def get_srid(self):
"Gets the SRID for the geometry, returns None if no SRID is set."
s = capi.geos_get_srid(self.ptr)
@@ -374,7 +373,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
capi.geos_set_srid(self.ptr, srid)
srid = property(get_srid, set_srid)
- #### Output Routines ####
+ # #### Output Routines ####
@property
def ewkt(self):
"""
@@ -454,7 +453,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"""
return PreparedGeometry(self)
- #### GDAL-specific output routines ####
+ # #### GDAL-specific output routines ####
@property
def ogr(self):
"Returns the OGR Geometry for this Geometry."
@@ -525,7 +524,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
else:
raise GEOSException('Transformed WKB was invalid.')
- #### Topology Routines ####
+ # #### Topology Routines ####
def _topology(self, gptr):
"Helper routine to return Geometry from the given pointer."
return GEOSGeometry(gptr, srid=self.srid)
@@ -639,7 +638,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
"Returns a Geometry representing all the points in this Geometry and other."
return self._topology(capi.geos_union(self.ptr, other.ptr))
- #### Other Routines ####
+ # #### Other Routines ####
@property
def area(self):
"Returns the area of the Geometry."
diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
index 207fa780a4..f218b17f6f 100644
--- a/django/contrib/gis/geos/libgeos.py
+++ b/django/contrib/gis/geos/libgeos.py
@@ -87,7 +87,7 @@ def error_h(fmt, lst):
logger.error('GEOS_ERROR: %s\n' % err_msg)
error_h = ERRORFUNC(error_h)
-#### GEOS Geometry C data structures, and utility functions. ####
+# #### GEOS Geometry C data structures, and utility functions. ####
# Opaque GEOS geometry structures, used for GEOM_PTR and CS_PTR
diff --git a/django/contrib/gis/geos/linestring.py b/django/contrib/gis/geos/linestring.py
index 829ab48945..ec06cb19e8 100644
--- a/django/contrib/gis/geos/linestring.py
+++ b/django/contrib/gis/geos/linestring.py
@@ -11,7 +11,6 @@ class LineString(GEOSGeometry):
_init_func = capi.create_linestring
_minlength = 2
- #### Python 'magic' routines ####
def __init__(self, *args, **kwargs):
"""
Initializes on the given sequence -- may take lists, tuples, NumPy arrays
@@ -116,7 +115,7 @@ class LineString(GEOSGeometry):
if dim not in (2, 3):
raise TypeError('Dimension mismatch.')
- #### Sequence Properties ####
+ # #### Sequence Properties ####
@property
def tuple(self):
"Returns a tuple version of the geometry from the coordinate sequence."
diff --git a/django/contrib/gis/geos/mutable_list.py b/django/contrib/gis/geos/mutable_list.py
index f01bc4275f..cea3710622 100644
--- a/django/contrib/gis/geos/mutable_list.py
+++ b/django/contrib/gis/geos/mutable_list.py
@@ -63,7 +63,7 @@ class ListMixin(object):
_maxlength = None
_IndexError = IndexError
- ### Python initialization and special list interface methods ###
+ # ### Python initialization and special list interface methods ###
def __init__(self, *args, **kwargs):
if not hasattr(self, '_get_single_internal'):
@@ -117,7 +117,7 @@ class ListMixin(object):
for i in range(len(self)):
yield self[i]
- ### Special methods for arithmetic operations ###
+ # ### Special methods for arithmetic operations ###
def __add__(self, other):
'add another list-like object'
return self.__class__(list(self) + list(other))
@@ -175,8 +175,8 @@ class ListMixin(object):
return False
return len(self) < olen
- ### Public list interface Methods ###
- ## Non-mutating ##
+ # ### Public list interface Methods ###
+ # ## Non-mutating ##
def count(self, val):
"Standard list count method"
count = 0
@@ -192,7 +192,7 @@ class ListMixin(object):
return i
raise ValueError('%s not found in object' % str(val))
- ## Mutating ##
+ # ## Mutating ##
def append(self, val):
"Standard list append method"
self[len(self):] = [val]
@@ -235,7 +235,7 @@ class ListMixin(object):
temp.sort(reverse=reverse)
self[:] = temp
- ### Private routines ###
+ # ### Private routines ###
def _rebuild(self, newLen, newItems):
if newLen < self._minlength:
raise ValueError('Must have at least %d items' % self._minlength)
diff --git a/django/contrib/gis/geos/point.py b/django/contrib/gis/geos/point.py
index 2cc5c13683..dadab29bbf 100644
--- a/django/contrib/gis/geos/point.py
+++ b/django/contrib/gis/geos/point.py
@@ -128,7 +128,7 @@ class Point(GEOSGeometry):
y = property(get_y, set_y)
z = property(get_z, set_z)
- ### Tuple setting and retrieval routines. ###
+ # ### Tuple setting and retrieval routines. ###
def get_coords(self):
"Returns a tuple of the point."
return self._cs.tuple
diff --git a/django/contrib/gis/geos/polygon.py b/django/contrib/gis/geos/polygon.py
index 38b533df8f..89dd0f06f6 100644
--- a/django/contrib/gis/geos/polygon.py
+++ b/django/contrib/gis/geos/polygon.py
@@ -66,7 +66,7 @@ class Polygon(GEOSGeometry):
(x0, y0, x0, y1, x1, y1, x1, y0, x0, y0))
return Polygon(((x0, y0), (x0, y1), (x1, y1), (x1, y0), (x0, y0)))
- ### These routines are needed for list-like operation w/ListMixin ###
+ # ### These routines are needed for list-like operation w/ListMixin ###
def _create_polygon(self, length, items):
# Instantiate LinearRing objects if necessary, but don't clone them yet
# _construct_ring will throw a TypeError if a parameter isn't a valid ring
@@ -143,7 +143,7 @@ class Polygon(GEOSGeometry):
_set_single = GEOSGeometry._set_single_rebuild
_assign_extended_slice = GEOSGeometry._assign_extended_slice_rebuild
- #### Polygon Properties ####
+ # #### Polygon Properties ####
@property
def num_interior_rings(self):
"Returns the number of interior rings."
diff --git a/django/contrib/gis/geos/prototypes/coordseq.py b/django/contrib/gis/geos/prototypes/coordseq.py
index b115fc3447..d5aa3da318 100644
--- a/django/contrib/gis/geos/prototypes/coordseq.py
+++ b/django/contrib/gis/geos/prototypes/coordseq.py
@@ -4,7 +4,7 @@ from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSExce
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
-## Error-checking routines specific to coordinate sequences. ##
+# ## Error-checking routines specific to coordinate sequences. ##
def check_cs_ptr(result, func, cargs):
"Error checking on routines that return Geometries."
if not result:
@@ -30,7 +30,7 @@ def check_cs_get(result, func, cargs):
return last_arg_byref(cargs)
-## Coordinate sequence prototype generation functions. ##
+# ## Coordinate sequence prototype generation functions. ##
def cs_int(func):
"For coordinate sequence routines that return an integer."
func.argtypes = [CS_PTR, POINTER(c_uint)]
@@ -66,7 +66,7 @@ def cs_output(func, argtypes):
func.errcheck = check_cs_ptr
return func
-## Coordinate Sequence ctypes prototypes ##
+# ## Coordinate Sequence ctypes prototypes ##
# Coordinate Sequence constructors & cloning.
cs_clone = cs_output(GEOSFunc('GEOSCoordSeq_clone'), [CS_PTR])
diff --git a/django/contrib/gis/geos/prototypes/errcheck.py b/django/contrib/gis/geos/prototypes/errcheck.py
index 034cfe5899..0a624ccec7 100644
--- a/django/contrib/gis/geos/prototypes/errcheck.py
+++ b/django/contrib/gis/geos/prototypes/errcheck.py
@@ -13,7 +13,6 @@ free.argtypes = [c_void_p]
free.restype = None
-### ctypes error checking routines ###
def last_arg_byref(args):
"Returns the last C argument's value by reference."
return args[-1]._obj.value
diff --git a/django/contrib/gis/geos/prototypes/geom.py b/django/contrib/gis/geos/prototypes/geom.py
index 021fe6e469..5416625c67 100644
--- a/django/contrib/gis/geos/prototypes/geom.py
+++ b/django/contrib/gis/geos/prototypes/geom.py
@@ -19,7 +19,7 @@ class geos_char_p(c_char_p):
pass
-### ctypes generation functions ###
+# ### ctypes generation functions ###
def bin_constructor(func):
"Generates a prototype for binary construction (HEX, WKB) GEOS routines."
func.argtypes = [c_char_p, c_size_t]
@@ -69,7 +69,7 @@ def string_from_geom(func):
func.errcheck = check_string
return func
-### ctypes prototypes ###
+# ### ctypes prototypes ###
# Deprecated creation routines from WKB, HEX, WKT
from_hex = bin_constructor(GEOSFunc('GEOSGeomFromHEX_buf'))
diff --git a/django/contrib/gis/geos/prototypes/io.py b/django/contrib/gis/geos/prototypes/io.py
index 34bd34886a..8083d93ee0 100644
--- a/django/contrib/gis/geos/prototypes/io.py
+++ b/django/contrib/gis/geos/prototypes/io.py
@@ -10,7 +10,7 @@ from django.utils import six
from django.utils.encoding import force_bytes
-### The WKB/WKT Reader/Writer structures and pointers ###
+# ### The WKB/WKT Reader/Writer structures and pointers ###
class WKTReader_st(Structure):
pass
@@ -31,7 +31,7 @@ WKT_WRITE_PTR = POINTER(WKTWriter_st)
WKB_READ_PTR = POINTER(WKBReader_st)
WKB_WRITE_PTR = POINTER(WKBReader_st)
-### WKTReader routines ###
+# WKTReader routines
wkt_reader_create = GEOSFunc('GEOSWKTReader_create')
wkt_reader_create.restype = WKT_READ_PTR
@@ -43,7 +43,7 @@ wkt_reader_read.argtypes = [WKT_READ_PTR, c_char_p]
wkt_reader_read.restype = GEOM_PTR
wkt_reader_read.errcheck = check_geom
-### WKTWriter routines ###
+# WKTWriter routines
wkt_writer_create = GEOSFunc('GEOSWKTWriter_create')
wkt_writer_create.restype = WKT_WRITE_PTR
@@ -67,7 +67,7 @@ except AttributeError:
wkt_writer_get_outdim = lambda ptr: 2
wkt_writer_set_outdim = lambda ptr, dim: None
-### WKBReader routines ###
+# WKBReader routines
wkb_reader_create = GEOSFunc('GEOSWKBReader_create')
wkb_reader_create.restype = WKB_READ_PTR
@@ -89,7 +89,7 @@ def wkb_read_func(func):
wkb_reader_read = wkb_read_func(GEOSFunc('GEOSWKBReader_read'))
wkb_reader_read_hex = wkb_read_func(GEOSFunc('GEOSWKBReader_readHEX'))
-### WKBWriter routines ###
+# WKBWriter routines
wkb_writer_create = GEOSFunc('GEOSWKBWriter_create')
wkb_writer_create.restype = WKB_WRITE_PTR
@@ -127,7 +127,7 @@ wkb_writer_get_include_srid = wkb_writer_get(GEOSFunc('GEOSWKBWriter_getIncludeS
wkb_writer_set_include_srid = wkb_writer_set(GEOSFunc('GEOSWKBWriter_setIncludeSRID'), argtype=c_char)
-### Base I/O Class ###
+# ### Base I/O Class ###
class IOBase(GEOSBase):
"Base class for GEOS I/O objects."
def __init__(self):
@@ -139,7 +139,7 @@ class IOBase(GEOSBase):
if self._ptr:
self._destructor(self._ptr)
-### Base WKB/WKT Reading and Writing objects ###
+# ### Base WKB/WKT Reading and Writing objects ###
# Non-public WKB/WKT reader classes for internal use because
@@ -172,7 +172,7 @@ class _WKBReader(IOBase):
raise TypeError
-### WKB/WKT Writer Classes ###
+# ### WKB/WKT Writer Classes ###
class WKTWriter(IOBase):
_constructor = wkt_writer_create
_destructor = wkt_writer_destroy
@@ -206,7 +206,7 @@ class WKBWriter(IOBase):
"Returns the HEXEWKB representation of the given geometry."
return wkb_writer_write_hex(self.ptr, geom.ptr, byref(c_size_t()))
- ### WKBWriter Properties ###
+ # ### WKBWriter Properties ###
# Property for getting/setting the byteorder.
def _get_byteorder(self):
diff --git a/django/contrib/gis/geos/prototypes/misc.py b/django/contrib/gis/geos/prototypes/misc.py
index 0e62e916b0..b256fd3d0b 100644
--- a/django/contrib/gis/geos/prototypes/misc.py
+++ b/django/contrib/gis/geos/prototypes/misc.py
@@ -12,7 +12,7 @@ from django.utils.six.moves import range
__all__ = ['geos_area', 'geos_distance', 'geos_length', 'geos_isvalidreason']
-### ctypes generator function ###
+# ### ctypes generator function ###
def dbl_from_geom(func, num_geom=1):
"""
Argument is a Geometry, return type is double that is passed
@@ -25,7 +25,7 @@ def dbl_from_geom(func, num_geom=1):
func.errcheck = check_dbl
return func
-### ctypes prototypes ###
+# ### ctypes prototypes ###
# Area, distance, and length prototypes.
geos_area = dbl_from_geom(GEOSFunc('GEOSArea'))
diff --git a/django/contrib/gis/geos/prototypes/predicates.py b/django/contrib/gis/geos/prototypes/predicates.py
index f3c30a5062..0bd1fabf9f 100644
--- a/django/contrib/gis/geos/prototypes/predicates.py
+++ b/django/contrib/gis/geos/prototypes/predicates.py
@@ -8,7 +8,7 @@ from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
-## Binary & unary predicate functions ##
+# ## Binary & unary predicate functions ##
def binary_predicate(func, *args):
"For GEOS binary predicate functions."
argtypes = [GEOM_PTR, GEOM_PTR]
@@ -27,14 +27,14 @@ def unary_predicate(func):
func.errcheck = check_predicate
return func
-## Unary Predicates ##
+# ## Unary Predicates ##
geos_hasz = unary_predicate(GEOSFunc('GEOSHasZ'))
geos_isempty = unary_predicate(GEOSFunc('GEOSisEmpty'))
geos_isring = unary_predicate(GEOSFunc('GEOSisRing'))
geos_issimple = unary_predicate(GEOSFunc('GEOSisSimple'))
geos_isvalid = unary_predicate(GEOSFunc('GEOSisValid'))
-## Binary Predicates ##
+# ## Binary Predicates ##
geos_contains = binary_predicate(GEOSFunc('GEOSContains'))
geos_crosses = binary_predicate(GEOSFunc('GEOSCrosses'))
geos_disjoint = binary_predicate(GEOSFunc('GEOSDisjoint'))
diff --git a/django/contrib/gis/geos/prototypes/topology.py b/django/contrib/gis/geos/prototypes/topology.py
index 83d6706eaa..06daa12cca 100644
--- a/django/contrib/gis/geos/prototypes/topology.py
+++ b/django/contrib/gis/geos/prototypes/topology.py
@@ -27,7 +27,7 @@ def topology(func, *args, **kwargs):
func.errcheck = kwargs.get('errcheck', check_geom)
return func
-### Topology Routines ###
+# Topology Routines
geos_boundary = topology(GEOSFunc('GEOSBoundary'))
geos_buffer = topology(GEOSFunc('GEOSBuffer'), c_double, c_int)
geos_centroid = topology(GEOSFunc('GEOSGetCentroid'))
diff --git a/django/contrib/gis/geos/tests/test_geos.py b/django/contrib/gis/geos/tests/test_geos.py
index 48d4aabf13..794ed6d75e 100644
--- a/django/contrib/gis/geos/tests/test_geos.py
+++ b/django/contrib/gis/geos/tests/test_geos.py
@@ -466,7 +466,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
def test_memory_hijinks(self):
"Testing Geometry __del__() on rings and polygons."
- #### Memory issues with rings and polygons
+ # #### Memory issues with rings and poly
# These tests are needed to ensure sanity with writable geometries.
@@ -661,7 +661,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
def test_mutable_geometries(self):
"Testing the mutability of Polygons and Geometry Collections."
- ### Testing the mutability of Polygons ###
+ # ### Testing the mutability of Polygons ###
for p in self.geometries.polygons:
poly = fromstr(p.wkt)
@@ -681,7 +681,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
self.assertEqual(poly.exterior_ring, new_shell)
self.assertEqual(poly[0], new_shell)
- ### Testing the mutability of Geometry Collections
+ # ### Testing the mutability of Geometry Collections
for tg in self.geometries.multipoints:
mp = fromstr(tg.wkt)
for i in range(len(mp)):
@@ -719,11 +719,11 @@ class GEOSTest(unittest.TestCase, TestDataMixin):
# Extreme (!!) __setitem__ -- no longer works, have to detect
# in the first object that __setitem__ is called in the subsequent
# objects -- maybe mpoly[0, 0, 0] = (3.14, 2.71)?
- #mpoly[0][0][0] = (3.14, 2.71)
- #self.assertEqual((3.14, 2.71), mpoly[0][0][0])
+ # mpoly[0][0][0] = (3.14, 2.71)
+ # self.assertEqual((3.14, 2.71), mpoly[0][0][0])
# Doing it more slowly..
- #self.assertEqual((3.14, 2.71), mpoly[0].shell[0])
- #del mpoly
+ # self.assertEqual((3.14, 2.71), mpoly[0].shell[0])
+ # del mpoly
def test_threed(self):
"Testing three-dimensional geometries."
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index 7c999a20d0..830fe72e62 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -37,7 +37,7 @@ class GeoModelTest(TestCase):
def test_proxy(self):
"Testing Lazy-Geometry support (using the GeometryProxy)."
- ## Testing on a Point
+ # Testing on a Point
pnt = Point(0, 0)
nullcity = City(name='NullCity', point=pnt)
nullcity.save()
@@ -74,7 +74,7 @@ class GeoModelTest(TestCase):
self.assertEqual(Point(23, 5), City.objects.get(name='NullCity').point)
nullcity.delete()
- ## Testing on a Polygon
+ # Testing on a Polygon
shell = LinearRing((0, 0), (0, 100), (100, 100), (100, 0), (0, 0))
inner = LinearRing((40, 40), (40, 60), (60, 60), (60, 40), (40, 40))
diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py
index 2ff23fc38b..410024e324 100644
--- a/django/contrib/gis/utils/layermapping.py
+++ b/django/contrib/gis/utils/layermapping.py
@@ -144,7 +144,7 @@ class LayerMapping(object):
else:
raise LayerMapError('Unrecognized transaction mode: %s' % transaction_mode)
- #### Checking routines used during initialization ####
+ # #### Checking routines used during initialization ####
def check_fid_range(self, fid_range):
"This checks the `fid_range` keyword."
if fid_range:
@@ -331,7 +331,7 @@ class LayerMapping(object):
else:
return {fld: kwargs[fld] for fld in self.unique}
- #### Verification routines used in constructing model keyword arguments. ####
+ # #### Verification routines used in constructing model keyword arguments. ####
def verify_ogr_field(self, ogr_field, model_field):
"""
Verifies if the OGR Field contents are acceptable to the Django
@@ -441,7 +441,7 @@ class LayerMapping(object):
# Returning the WKT of the geometry.
return g.wkt
- #### Other model methods ####
+ # #### Other model methods ####
def coord_transform(self):
"Returns the coordinate transformation object."
SpatialRefSys = self.spatial_backend.spatial_ref_sys()
diff --git a/django/db/backends/base/base.py b/django/db/backends/base/base.py
index cbc4983046..5c0e8755ea 100644
--- a/django/db/backends/base/base.py
+++ b/django/db/backends/base/base.py
@@ -84,7 +84,7 @@ class BaseDatabaseWrapper(object):
"will be returned.".format(self.queries_log.maxlen))
return list(self.queries_log)
- ##### Backend-specific methods for creating connections and cursors #####
+ # ##### Backend-specific methods for creating connections and cursors #####
def get_connection_params(self):
"""Returns a dict of parameters suitable for get_new_connection."""
@@ -102,7 +102,7 @@ class BaseDatabaseWrapper(object):
"""Creates a cursor. Assumes that a connection is established."""
raise NotImplementedError('subclasses of BaseDatabaseWrapper may require a create_cursor() method')
- ##### Backend-specific methods for creating connections #####
+ # ##### Backend-specific methods for creating connections #####
def connect(self):
"""Connects to the database. Assumes that the connection is closed."""
@@ -130,7 +130,7 @@ class BaseDatabaseWrapper(object):
with self.wrap_database_errors:
self.connect()
- ##### Backend-specific wrappers for PEP-249 connection methods #####
+ # ##### Backend-specific wrappers for PEP-249 connection methods #####
def _cursor(self):
self.ensure_connection()
@@ -152,7 +152,7 @@ class BaseDatabaseWrapper(object):
with self.wrap_database_errors:
return self.connection.close()
- ##### Generic wrappers for PEP-249 connection methods #####
+ # ##### Generic wrappers for PEP-249 connection methods #####
def cursor(self):
"""
@@ -204,7 +204,7 @@ class BaseDatabaseWrapper(object):
else:
self.connection = None
- ##### Backend-specific savepoint management methods #####
+ # ##### Backend-specific savepoint management methods #####
def _savepoint(self, sid):
with self.cursor() as cursor:
@@ -222,7 +222,7 @@ class BaseDatabaseWrapper(object):
# Savepoints cannot be created outside a transaction
return self.features.uses_savepoints and not self.get_autocommit()
- ##### Generic savepoint management methods #####
+ # ##### Generic savepoint management methods #####
def savepoint(self):
"""
@@ -270,7 +270,7 @@ class BaseDatabaseWrapper(object):
"""
self.savepoint_state = 0
- ##### Backend-specific transaction management methods #####
+ # ##### Backend-specific transaction management methods #####
def _set_autocommit(self, autocommit):
"""
@@ -278,7 +278,7 @@ class BaseDatabaseWrapper(object):
"""
raise NotImplementedError('subclasses of BaseDatabaseWrapper may require a _set_autocommit() method')
- ##### Generic transaction management methods #####
+ # ##### Generic transaction management methods #####
def get_autocommit(self):
"""
@@ -328,7 +328,7 @@ class BaseDatabaseWrapper(object):
"An error occurred in the current transaction. You can't "
"execute queries until the end of the 'atomic' block.")
- ##### Foreign key constraints checks handling #####
+ # ##### Foreign key constraints checks handling #####
@contextmanager
def constraint_checks_disabled(self):
@@ -365,7 +365,7 @@ class BaseDatabaseWrapper(object):
"""
pass
- ##### Connection termination handling #####
+ # ##### Connection termination handling #####
def is_usable(self):
"""
@@ -404,7 +404,7 @@ class BaseDatabaseWrapper(object):
self.close()
return
- ##### Thread safety handling #####
+ # ##### Thread safety handling #####
def validate_thread_sharing(self):
"""
@@ -421,7 +421,7 @@ class BaseDatabaseWrapper(object):
"thread id %s."
% (self.alias, self._thread_ident, thread.get_ident()))
- ##### Miscellaneous #####
+ # ##### Miscellaneous #####
def prepare_database(self):
"""
diff --git a/django/template/__init__.py b/django/template/__init__.py
index 3d26bcc945..b2566decad 100644
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -39,7 +39,7 @@ Shared:
"""
-### Multiple Template Engines
+# Multiple Template Engines
from .engine import Engine
@@ -51,7 +51,7 @@ engines = EngineHandler()
__all__ = ('Engine', 'engines')
-### Django Template Language
+# Django Template Language
# Public exceptions
from .base import (TemplateDoesNotExist, TemplateSyntaxError, # NOQA
diff --git a/docs/_ext/applyxrefs.py b/docs/_ext/applyxrefs.py
index 513c17d84e..d4cd79137e 100644
--- a/docs/_ext/applyxrefs.py
+++ b/docs/_ext/applyxrefs.py
@@ -34,7 +34,7 @@ def has_target(fn):
print("Can't open or read %s. Not touching it." % fn)
return (True, None)
- #print fn, len(lines)
+ # print fn, len(lines)
if len(lines) < 1:
print("Not touching empty file %s." % fn)
return (True, None)
@@ -56,7 +56,7 @@ def main(argv=None):
files.extend((dirpath, f) for f in filenames)
files.sort()
files = [os.path.join(p, fn) for p, fn in files if fn.endswith('.txt')]
- #print files
+ # print files
for fn in files:
if fn in DONT_TOUCH:
diff --git a/docs/conf.py b/docs/conf.py
index a8ad090287..be1050ba36 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -56,7 +56,7 @@ spelling_word_list_filename = 'spelling_wordlist'
source_suffix = '.txt'
# The encoding of source files.
-#source_encoding = 'utf-8-sig'
+# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'contents'
@@ -91,14 +91,14 @@ django_next_version = '1.9'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
-#language = None
+# language = None
# Location for .po/.mo translation files used when language is set
locale_dirs = ['locale/']
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
-#today = ''
+# today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
@@ -107,7 +107,7 @@ today_fmt = '%B %d, %Y'
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
+# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
@@ -145,31 +145,31 @@ html_theme = "djangodocs"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-#html_theme_options = {}
+# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ["_theme"]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
-#html_title = None
+# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
+# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
-#html_logo = None
+# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
-#html_favicon = None
+# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ["_static"]
+# html_static_path = ["_static"]
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
@@ -183,40 +183,40 @@ html_use_smartypants = True
html_translator_class = "djangodocs.DjangoHTMLTranslator"
# Content template for the index page.
-#html_index = ''
+# html_index = ''
# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
+# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
html_additional_pages = {}
# If false, no module index is generated.
-#html_domain_indices = True
+# html_domain_indices = True
# If false, no index is generated.
-#html_use_index = True
+# html_use_index = True
# If true, the index is split into individual pages for each letter.
-#html_split_index = False
+# html_split_index = False
# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
+# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
+# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
+# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
+# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
+# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Djangodoc'
@@ -241,7 +241,7 @@ latex_elements = {
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
-#latex_documents = []
+# latex_documents = []
latex_documents = [
('contents', 'django.tex', 'Django Documentation',
'Django Software Foundation', 'manual'),
@@ -249,23 +249,23 @@ latex_documents = [
# The name of an image file (relative to this directory) to place at the top of
# the title page.
-#latex_logo = None
+# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
-#latex_use_parts = False
+# latex_use_parts = False
# If true, show page references after internal links.
-#latex_show_pagerefs = False
+# latex_show_pagerefs = False
# If true, show URL addresses after external links.
-#latex_show_urls = False
+# latex_show_urls = False
# Documents to append as an appendix to all manuals.
-#latex_appendices = []
+# latex_appendices = []
# If false, no module index is generated.
-#latex_domain_indices = True
+# latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
@@ -296,7 +296,7 @@ epub_publisher = 'Django Software Foundation'
epub_copyright = copyright
# The basename for the epub file. It defaults to the project name.
-#epub_basename = 'Django'
+# epub_basename = 'Django'
# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
@@ -306,55 +306,55 @@ epub_theme = 'djangodocs-epub'
# The language of the text. It defaults to the language option
# or en if the language is not set.
-#epub_language = ''
+# epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
-#epub_scheme = ''
+# epub_scheme = ''
# The unique identifier of the text. This can be an ISBN number
# or the project homepage.
-#epub_identifier = ''
+# epub_identifier = ''
# A unique identification for the text.
-#epub_uid = ''
+# epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
epub_cover = ('', 'epub-cover.html')
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
-#epub_guide = ()
+# epub_guide = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
-#epub_pre_files = []
+# epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
-#epub_post_files = []
+# epub_post_files = []
# A list of files that should not be packed into the epub file.
-#epub_exclude_files = []
+# epub_exclude_files = []
# The depth of the table of contents in toc.ncx.
-#epub_tocdepth = 3
+# epub_tocdepth = 3
# Allow duplicate toc entries.
-#epub_tocdup = True
+# epub_tocdup = True
# Choose between 'default' and 'includehidden'.
-#epub_tocscope = 'default'
+# epub_tocscope = 'default'
# Fix unsupported image types using the PIL.
-#epub_fix_images = False
+# epub_fix_images = False
# Scale large images.
-#epub_max_image_width = 0
+# epub_max_image_width = 0
# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#epub_show_urls = 'inline'
+# epub_show_urls = 'inline'
# If false, no index is generated.
-#epub_use_index = True
+# epub_use_index = True
# -- ticket options ------------------------------------------------------------
ticket_url = 'https://code.djangoproject.com/ticket/%s'
diff --git a/setup.cfg b/setup.cfg
index 58c9b2914c..28353841d8 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
[flake8]
exclude=build,.git,./django/utils/dictconfig.py,./django/utils/unittest.py,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner
-ignore=E123,E128,E265,E501,W601
+ignore=E123,E128,E501,W601
max-line-length = 119
[metadata]
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index 979ebefa01..983073a25f 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -464,7 +464,7 @@ class EscapingChecks(TestCase):
@unittest.skipUnless(connection.vendor == 'sqlite',
"This is an sqlite-specific issue")
def test_sqlite_parameter_escaping(self):
- #13648: '%s' escaping support for sqlite3
+ # '%s' escaping support for sqlite3 #13648
cursor = connection.cursor()
cursor.execute("select strftime('%s', date('now'))")
response = cursor.fetchall()[0][0]
@@ -502,7 +502,7 @@ class BackendTestCase(TransactionTestCase):
cursor.execute(query, args)
def test_cursor_executemany(self):
- #4896: Test cursor.executemany
+ # Test cursor.executemany #4896
args = [(i, i ** 2) for i in range(-5, 6)]
self.create_squares_with_executemany(args)
self.assertEqual(models.Square.objects.count(), 11)
@@ -511,13 +511,13 @@ class BackendTestCase(TransactionTestCase):
self.assertEqual(square.square, i ** 2)
def test_cursor_executemany_with_empty_params_list(self):
- #4765: executemany with params=[] does nothing
+ # Test executemany with params=[] does nothing #4765
args = []
self.create_squares_with_executemany(args)
self.assertEqual(models.Square.objects.count(), 0)
def test_cursor_executemany_with_iterator(self):
- #10320: executemany accepts iterators
+ # Test executemany accepts iterators #10320
args = iter((i, i ** 2) for i in range(-3, 2))
self.create_squares_with_executemany(args)
self.assertEqual(models.Square.objects.count(), 5)
@@ -530,14 +530,14 @@ class BackendTestCase(TransactionTestCase):
@skipUnlessDBFeature('supports_paramstyle_pyformat')
def test_cursor_execute_with_pyformat(self):
- #10070: Support pyformat style passing of parameters
+ # Support pyformat style passing of parameters #10070
args = {'root': 3, 'square': 9}
self.create_squares(args, 'pyformat', multiple=False)
self.assertEqual(models.Square.objects.count(), 1)
@skipUnlessDBFeature('supports_paramstyle_pyformat')
def test_cursor_executemany_with_pyformat(self):
- #10070: Support pyformat style passing of parameters
+ # Support pyformat style passing of parameters #10070
args = [{'root': i, 'square': i ** 2} for i in range(-5, 6)]
self.create_squares(args, 'pyformat', multiple=True)
self.assertEqual(models.Square.objects.count(), 11)
@@ -558,7 +558,7 @@ class BackendTestCase(TransactionTestCase):
self.assertEqual(models.Square.objects.count(), 9)
def test_unicode_fetches(self):
- #6254: fetchone, fetchmany, fetchall return strings as unicode objects
+ # fetchone, fetchmany, fetchall return strings as unicode objects #6254
qn = connection.ops.quote_name
models.Person(first_name="John", last_name="Doe").save()
models.Person(first_name="Jane", last_name="Doe").save()
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
index 14ad306c65..8bc3302afc 100644
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -345,7 +345,7 @@ class HttpResponseTests(unittest.TestCase):
# test odd inputs
r = HttpResponse()
r.content = ['1', '2', 3, '\u079e']
- #'\xde\x9e' == unichr(1950).encode('utf-8')
+ # '\xde\x9e' == unichr(1950).encode('utf-8')
self.assertEqual(r.content, b'123\xde\x9e')
# .content can safely be accessed multiple times.
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py
index cc6b33e572..c6c230b9c5 100644
--- a/tests/introspection/tests.py
+++ b/tests/introspection/tests.py
@@ -30,7 +30,7 @@ class IntrospectionTests(TransactionTestCase):
"django_table_names() returned a non-Django table")
def test_django_table_names_retval_type(self):
- #15216 - Table name is a list
+ # Table name is a list #15216
tl = connection.introspection.django_table_names(only_existing=True)
self.assertIs(type(tl), list)
tl = connection.introspection.django_table_names(only_existing=False)
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 0f86289cff..8f6c574600 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -360,7 +360,7 @@ class MakeMigrationsTests(MigrationTestBase):
self.assertIn('\\u201c\\xd0j\\xe1\\xf1g\\xf3\\u201d', content) # title.default
def test_failing_migration(self):
- #21280 - If a migration fails to serialize, it shouldn't generate an empty file.
+ # If a migration fails to serialize, it shouldn't generate an empty file. #21280
apps.register_model('migrations', UnserializableModel)
with six.assertRaisesRegex(self, ValueError, r'Cannot serialize'):
diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py
index 2c6b707b88..f8ce329e7b 100644
--- a/tests/model_fields/models.py
+++ b/tests/model_fields/models.py
@@ -166,7 +166,7 @@ class VerboseNameField(models.Model):
field10 = models.FilePathField("verbose field10")
field11 = models.FloatField("verbose field11")
# Don't want to depend on Pillow in this test
- #field_image = models.ImageField("verbose field")
+ # field_image = models.ImageField("verbose field")
field12 = models.IntegerField("verbose field12")
field13 = models.IPAddressField("verbose field13")
field14 = models.GenericIPAddressField("verbose field14", protocol="ipv4")
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 4bb7c47eb2..c7acf948a7 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -955,10 +955,10 @@ class ModelToDictTests(TestCase):
with self.assertNumQueries(0):
d = model_to_dict(art)
- #Ensure all many-to-many categories appear in model_to_dict
+ # Ensure all many-to-many categories appear in model_to_dict
for c in categories:
self.assertIn(c.pk, d['categories'])
- #Ensure many-to-many relation appears as a list
+ # Ensure many-to-many relation appears as a list
self.assertIsInstance(d['categories'], list)
diff --git a/tests/model_regress/models.py b/tests/model_regress/models.py
index c42b0f0d35..0798069043 100644
--- a/tests/model_regress/models.py
+++ b/tests/model_regress/models.py
@@ -29,7 +29,7 @@ class Article(models.Model):
class Movie(models.Model):
- #5218: Test models with non-default primary keys / AutoFields
+ # Test models with non-default primary keys / AutoFields #5218
movie_id = models.AutoField(primary_key=True)
name = models.CharField(max_length=60)
@@ -73,7 +73,7 @@ class NonAutoPK(models.Model):
name = models.CharField(max_length=10, primary_key=True)
-#18432: Chained foreign keys with to_field produce incorrect query
+# Chained foreign keys with to_field produce incorrect query #18432
class Model1(models.Model):
pkey = models.IntegerField(unique=True, db_index=True)
diff --git a/tests/prefetch_related/models.py b/tests/prefetch_related/models.py
index 40540e9b26..c4adb00877 100644
--- a/tests/prefetch_related/models.py
+++ b/tests/prefetch_related/models.py
@@ -6,7 +6,7 @@ from django.db import models
from django.utils.encoding import python_2_unicode_compatible
-## Basic tests
+# Basic tests
@python_2_unicode_compatible
class Author(models.Model):
@@ -88,7 +88,7 @@ class BookReview(models.Model):
notes = models.TextField(null=True, blank=True)
-## Models for default manager tests
+# Models for default manager tests
class Qualification(models.Model):
name = models.CharField(max_length=10)
@@ -124,7 +124,7 @@ class Department(models.Model):
ordering = ['id']
-## GenericRelation/GenericForeignKey tests
+# GenericRelation/GenericForeignKey tests
@python_2_unicode_compatible
class TaggedItem(models.Model):
@@ -172,7 +172,7 @@ class Comment(models.Model):
ordering = ['id']
-## Models for lookup ordering tests
+# Models for lookup ordering tests
class House(models.Model):
name = models.CharField(max_length=50)
@@ -209,7 +209,7 @@ class Person(models.Model):
ordering = ['id']
-## Models for nullable FK tests
+# Models for nullable FK tests
@python_2_unicode_compatible
class Employee(models.Model):
@@ -224,7 +224,7 @@ class Employee(models.Model):
ordering = ['id']
-## Ticket #19607
+# Ticket #19607
@python_2_unicode_compatible
class LessonEntry(models.Model):
@@ -244,7 +244,7 @@ class WordEntry(models.Model):
return "%s (%s)" % (self.name, self.id)
-## Ticket #21410: Regression when related_name="+"
+# Ticket #21410: Regression when related_name="+"
@python_2_unicode_compatible
class Author2(models.Model):
diff --git a/tests/serializers_regress/tests.py b/tests/serializers_regress/tests.py
index 2c99ed77b3..0c07b3162c 100644
--- a/tests/serializers_regress/tests.py
+++ b/tests/serializers_regress/tests.py
@@ -241,7 +241,7 @@ test_data = [
(data_obj, 81, IntegerData, -123456789),
(data_obj, 82, IntegerData, 0),
(data_obj, 83, IntegerData, None),
- #(XX, ImageData
+ # (XX, ImageData
(data_obj, 90, IPAddressData, "127.0.0.1"),
(data_obj, 91, IPAddressData, None),
(data_obj, 95, GenericIPAddressData, "fe80:1424:2223:6cff:fe8a:2e8a:2151:abcd"),
diff --git a/tests/syndication_tests/tests.py b/tests/syndication_tests/tests.py
index 63638fa589..221d4c112e 100644
--- a/tests/syndication_tests/tests.py
+++ b/tests/syndication_tests/tests.py
@@ -94,7 +94,6 @@ class SyndicationFeedTest(FeedTestCase):
'link': 'http://example.com/blog/',
'language': 'en',
'lastBuildDate': last_build_date,
- #'atom:link': '',
'ttl': '600',
'copyright': 'Copyright (c) 2007, Sally Smith',
})
diff --git a/tests/urlpatterns_reverse/no_urls.py b/tests/urlpatterns_reverse/no_urls.py
index 1cd34c78f7..e69de29bb2 100644
--- a/tests/urlpatterns_reverse/no_urls.py
+++ b/tests/urlpatterns_reverse/no_urls.py
@@ -1 +0,0 @@
-#from django.conf.urls import patterns, url, include