Permalink
Browse files

Fixed many typos in comments and docstrings.

Thanks Piotr Kasprzyk for help with the patch.
  • Loading branch information...
1 parent 6acaa52 commit 0d912258921a442c48d5787228db2db5af7e8fa5 @rhcarvalho rhcarvalho committed with timgraham Mar 2, 2014
Showing with 208 additions and 208 deletions.
  1. +4 −4 django/contrib/admin/tests.py
  2. +1 −1 django/contrib/admin/utils.py
  3. +1 −1 django/contrib/auth/decorators.py
  4. +1 −1 django/contrib/auth/hashers.py
  5. +1 −1 django/contrib/auth/tests/test_management.py
  6. +1 −1 django/contrib/comments/views/moderation.py
  7. +2 −2 django/contrib/flatpages/tests/test_csrf.py
  8. +4 −4 django/contrib/flatpages/tests/test_middleware.py
  9. +1 −1 django/contrib/flatpages/tests/test_templatetags.py
  10. +2 −2 django/contrib/flatpages/tests/test_views.py
  11. +1 −1 django/contrib/formtools/tests/tests.py
  12. +2 −2 django/contrib/formtools/wizard/views.py
  13. +2 −2 django/contrib/gis/db/backends/base.py
  14. +2 −2 django/contrib/gis/db/backends/oracle/operations.py
  15. +1 −1 django/contrib/gis/db/backends/postgis/introspection.py
  16. +3 −3 django/contrib/gis/db/backends/postgis/operations.py
  17. +1 −1 django/contrib/gis/db/backends/spatialite/creation.py
  18. +2 −2 django/contrib/gis/db/backends/spatialite/operations.py
  19. +2 −2 django/contrib/gis/db/models/query.py
  20. +1 −1 django/contrib/gis/db/models/sql/compiler.py
  21. +1 −1 django/contrib/gis/feeds.py
  22. +4 −4 django/contrib/gis/gdal/prototypes/errcheck.py
  23. +1 −1 django/contrib/gis/gdal/srs.py
  24. +1 −1 django/contrib/gis/gdal/tests/test_envelope.py
  25. +1 −1 django/contrib/gis/gdal/tests/test_geom.py
  26. +1 −1 django/contrib/gis/geoip/base.py
  27. +1 −1 django/contrib/gis/geoip/prototypes.py
  28. +2 −2 django/contrib/gis/geos/geometry.py
  29. +2 −2 django/contrib/gis/geos/libgeos.py
  30. +4 −4 django/contrib/gis/geos/tests/test_geos.py
  31. +1 −1 django/contrib/gis/maps/google/overlays.py
  32. +1 −1 django/contrib/gis/measure.py
  33. +2 −2 django/contrib/gis/static/gis/js/OLMapWidget.js
  34. +1 −1 django/contrib/gis/tests/distapp/tests.py
  35. +2 −2 django/contrib/gis/tests/geoapp/tests.py
  36. +1 −1 django/contrib/gis/tests/inspectapp/tests.py
  37. +1 −1 django/contrib/gis/tests/maps/tests.py
  38. +5 −5 django/contrib/gis/tests/test_measure.py
  39. +1 −1 django/contrib/gis/utils/layermapping.py
  40. +1 −1 django/core/files/uploadhandler.py
  41. +1 −1 django/core/handlers/wsgi.py
  42. +2 −2 django/core/management/base.py
  43. +1 −1 django/core/management/commands/inspectdb.py
  44. +1 −1 django/core/management/commands/migrate.py
  45. +1 −1 django/core/management/commands/validate.py
  46. +1 −1 django/core/management/templates.py
  47. +1 −1 django/core/signing.py
  48. +2 −2 django/db/backends/__init__.py
  49. +2 −2 django/db/backends/oracle/base.py
  50. +1 −1 django/db/backends/schema.py
  51. +1 −1 django/db/migrations/executor.py
  52. +1 −1 django/db/migrations/loader.py
  53. +1 −1 django/db/migrations/migration.py
  54. +4 −4 django/db/migrations/optimizer.py
  55. +2 −2 django/db/models/deletion.py
  56. +2 −2 django/db/models/fields/__init__.py
  57. +5 −5 django/db/models/query.py
  58. +1 −1 django/db/models/query_utils.py
  59. +1 −1 django/db/models/related.py
  60. +1 −1 django/db/models/sql/compiler.py
  61. +2 −2 django/db/models/sql/query.py
  62. +1 −1 django/db/transaction.py
  63. +1 −1 django/dispatch/dispatcher.py
  64. +1 −1 django/forms/forms.py
  65. +1 −1 django/forms/formsets.py
  66. +3 −3 django/http/multipartparser.py
  67. +2 −2 django/http/response.py
  68. +1 −1 django/template/base.py
  69. +2 −2 django/template/defaulttags.py
  70. +1 −1 django/test/_doctest.py
  71. +1 −1 django/test/signals.py
  72. +1 −1 django/test/testcases.py
  73. +1 −1 django/test/utils.py
  74. +1 −1 django/utils/functional.py
  75. +5 −5 django/utils/html.py
  76. +1 −1 django/utils/ipv6.py
  77. +1 −1 django/utils/jslex.py
  78. +1 −1 django/utils/regex_helper.py
  79. +1 −1 django/utils/six.py
  80. +4 −4 tests/admin_changelist/tests.py
  81. +3 −3 tests/admin_inlines/tests.py
  82. +1 −1 tests/admin_ordering/tests.py
  83. +2 −2 tests/admin_scripts/tests.py
  84. +14 −14 tests/admin_views/tests.py
  85. +2 −2 tests/aggregation_regress/tests.py
  86. +5 −5 tests/backends/tests.py
  87. +1 −1 tests/basic/tests.py
  88. +1 −1 tests/cache/tests.py
  89. +1 −1 tests/defer/tests.py
  90. +1 −1 tests/extra_regress/tests.py
  91. +1 −1 tests/field_subclassing/fields.py
  92. +2 −2 tests/field_subclassing/tests.py
  93. +1 −1 tests/file_storage/tests.py
  94. +1 −1 tests/fixtures/tests.py
  95. +3 −3 tests/fixtures_regress/tests.py
  96. +1 −1 tests/foreign_object/models.py
  97. +1 −1 tests/forms_tests/tests/test_extra.py
  98. +1 −1 tests/forms_tests/tests/test_forms.py
  99. +1 −1 tests/generic_views/urls.py
  100. +1 −1 tests/i18n/test_extraction.py
  101. +2 −2 tests/inspectdb/tests.py
  102. +1 −1 tests/lookup/tests.py
  103. +2 −2 tests/m2m_recursive/tests.py
  104. +3 −3 tests/mail/tests.py
  105. +1 −1 tests/model_fields/tests.py
  106. +1 −1 tests/model_forms_regress/tests.py
  107. +1 −1 tests/model_regress/tests.py
  108. +1 −1 tests/modeladmin/tests.py
  109. +5 −5 tests/multiple_database/tests.py
  110. +2 −2 tests/mutually_referential/models.py
  111. +1 −1 tests/pagination/tests.py
  112. +1 −1 tests/queries/models.py
  113. +2 −2 tests/queries/tests.py
  114. +1 −1 tests/raw_query/tests.py
  115. +1 −1 tests/servers/tests.py
  116. +1 −1 tests/settings_tests/tests.py
  117. +1 −1 tests/template_tests/test_loaders.py
  118. +1 −1 tests/template_tests/tests.py
  119. +1 −1 tests/test_runner/tests.py
  120. +1 −1 tests/transactions_regress/tests.py
  121. +1 −1 tests/view_tests/generic_urls.py
@@ -54,7 +54,7 @@ def wait_loaded_tag(self, tag_name, timeout=10):
def wait_for(self, css_selector, timeout=10):
"""
- Helper function that blocks until an css selector is found on the page.
+ Helper function that blocks until a CSS selector is found on the page.
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
@@ -65,7 +65,7 @@ def wait_for(self, css_selector, timeout=10):
def wait_for_text(self, css_selector, text, timeout=10):
"""
- Helper function that blocks until the text is found in the css selector.
+ Helper function that blocks until the text is found in the CSS selector.
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
@@ -77,7 +77,7 @@ def wait_for_text(self, css_selector, text, timeout=10):
def wait_for_value(self, css_selector, text, timeout=10):
"""
- Helper function that blocks until the value is found in the css selector.
+ Helper function that blocks until the value is found in the CSS selector.
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
@@ -96,7 +96,7 @@ def wait_page_loaded(self):
# Wait for the next page to be loaded
self.wait_loaded_tag('body')
except TimeoutException:
- # IE7 occasionnally returns an error "Internet Explorer cannot
+ # IE7 occasionally returns an error "Internet Explorer cannot
# display the webpage" and doesn't load the next page. We just
# ignore it.
pass
@@ -108,7 +108,7 @@ def flatten_fieldsets(fieldsets):
def get_deleted_objects(objs, opts, user, admin_site, using):
"""
Find all objects related to ``objs`` that should also be deleted. ``objs``
- must be a homogenous iterable of objects (e.g. a QuerySet).
+ must be a homogeneous iterable of objects (e.g. a QuerySet).
Returns a nested list of strings suitable for display in the
template with the ``unordered_list`` filter.
@@ -56,7 +56,7 @@ def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login
def permission_required(perm, login_url=None, raise_exception=False):
"""
Decorator for views that checks whether a user has a particular permission
- enabled, redirecting to the log-in page if neccesary.
+ enabled, redirecting to the log-in page if necessary.
If the raise_exception parameter is given the PermissionDenied exception
is raised.
"""
@@ -186,7 +186,7 @@ def _load_library(self):
def salt(self):
"""
- Generates a cryptographically secure nonce salt in ascii
+ Generates a cryptographically secure nonce salt in ASCII
"""
return get_random_string()
@@ -39,7 +39,7 @@ def getpass(prompt=b'Password: ', stream=None):
def mock_input(prompt):
# prompt should be encoded in Python 2. This line will raise an
- # Exception if prompt contains unencoded non-ascii on Python 2.
+ # Exception if prompt contains unencoded non-ASCII on Python 2.
prompt = str(prompt)
assert str('__proxy__') not in prompt
response = ''
@@ -90,7 +90,7 @@ def approve(request, comment_id, next=None):
template.RequestContext(request)
)
-# The following functions actually perform the various flag/aprove/delete
+# The following functions actually perform the various flag/approve/delete
# actions. They've been broken out into separate functions to that they
# may be called from admin actions.
@@ -51,13 +51,13 @@ def test_view_authenticated_flatpage(self):
self.assertContains(response, "<p>Isn't it sekrit!</p>")
def test_fallback_flatpage(self):
- "A flatpage can be served by the fallback middlware"
+ "A flatpage can be served by the fallback middleware"
response = self.client.get('/flatpage/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<p>Isn't it flat!</p>")
def test_fallback_non_existent_flatpage(self):
- "A non-existent flatpage raises a 404 when served by the fallback middlware"
+ "A non-existent flatpage raises a 404 when served by the fallback middleware"
response = self.client.get('/no_such_flatpage/')
self.assertEqual(response.status_code, 404)
@@ -48,13 +48,13 @@ def test_view_authenticated_flatpage(self):
self.assertContains(response, "<p>Isn't it sekrit!</p>")
def test_fallback_flatpage(self):
- "A flatpage can be served by the fallback middlware"
+ "A flatpage can be served by the fallback middleware"
response = self.client.get('/flatpage/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<p>Isn't it flat!</p>")
def test_fallback_non_existent_flatpage(self):
- "A non-existent flatpage raises a 404 when served by the fallback middlware"
+ "A non-existent flatpage raises a 404 when served by the fallback middleware"
response = self.client.get('/no_such_flatpage/')
self.assertEqual(response.status_code, 404)
@@ -116,12 +116,12 @@ def test_redirect_view_non_existent_flatpage(self):
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_flatpage(self):
- "A flatpage can be served by the fallback middlware and should add a slash"
+ "A flatpage can be served by the fallback middleware and should add a slash"
response = self.client.get('/flatpage')
self.assertRedirects(response, '/flatpage/', status_code=301)
def test_redirect_fallback_non_existent_flatpage(self):
- "A non-existent flatpage raises a 404 when served by the fallback middlware and should not add a slash"
+ "A non-existent flatpage raises a 404 when served by the fallback middleware and should not add a slash"
response = self.client.get('/no_such_flatpage')
self.assertEqual(response.status_code, 404)
@@ -88,7 +88,7 @@ def test_get_flatpages_with_prefix_for_anon_user(self):
@skipIfCustomUser
def test_get_flatpages_with_prefix_for_user(self):
- "The flatpage template tag retrive prefixed flatpages for an authenticated user"
+ "The flatpage template tag retrieve prefixed flatpages for an authenticated user"
me = User.objects.create_user('testuser', 'test@example.com', 's3krit')
out = Template(
"{% load flatpages %}"
@@ -53,7 +53,7 @@ def test_fallback_flatpage(self):
self.assertEqual(response.status_code, 404)
def test_fallback_non_existent_flatpage(self):
- "A non-existent flatpage won't be served if the fallback middlware is disabled"
+ "A non-existent flatpage won't be served if the fallback middleware is disabled"
response = self.client.get('/no_such_flatpage/')
self.assertEqual(response.status_code, 404)
@@ -109,7 +109,7 @@ def test_redirect_fallback_flatpage(self):
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_non_existent_flatpage(self):
- "A non-existent flatpage won't be served if the fallback middlware is disabled and should not add a slash"
+ "A non-existent flatpage won't be served if the fallback middleware is disabled and should not add a slash"
response = self.client.get('/no_such_flatpage')
self.assertEqual(response.status_code, 404)
@@ -58,7 +58,7 @@ def test_form_get(self):
"""
Test contrib.formtools.preview form retrieval.
- Use the client library to see if we can sucessfully retrieve
+ Use the client library to see if we can successfully retrieve
the form (mostly testing the setup ROOT_URLCONF
process). Verify that an additional hidden input field
is created to manage the stage.
@@ -368,15 +368,15 @@ def get_form_prefix(self, step=None, form=None):
def get_form_initial(self, step):
"""
Returns a dictionary which will be passed to the form for `step`
- as `initial`. If no initial data was provied while initializing the
+ as `initial`. If no initial data was provided while initializing the
form wizard, a empty dictionary will be returned.
"""
return self.initial_dict.get(step, {})
def get_form_instance(self, step):
"""
Returns a object which will be passed to the form for `step`
- as `instance`. If no instance object was provied while initializing
+ as `instance`. If no instance object was provided while initializing
the form wizard, None will be returned.
"""
return self.instance_dict.get(step, None)
@@ -148,7 +148,7 @@ def spatial_ref_sys(self):
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
- SpatialRefSys objects to reduce redundnant code.
+ SpatialRefSys objects to reduce redundant code.
"""
# For pulling out the spheroid from the spatial reference string. This
# regular expression is used only if the user does not have GDAL installed.
@@ -304,7 +304,7 @@ def units(self):
def get_units(cls, wkt):
"""
Class method used by GeometryField on initialization to
- retrive the units on the given WKT, without having to use
+ retrieve the units on the given WKT, without having to use
any of the database fields.
"""
if gdal.HAS_GDAL:
@@ -196,7 +196,7 @@ def get_distance(self, f, value, lookup_type):
else:
dist_param = value
- # dwithin lookups on oracle require a special string parameter
+ # dwithin lookups on Oracle require a special string parameter
# that starts with "distance=".
if lookup_type == 'dwithin':
dist_param = 'distance=%s' % dist_param
@@ -220,7 +220,7 @@ def transform_value(val, srid):
placeholder = '%s(%%s, %s)' % (self.transform, f.srid)
else:
placeholder = '%s'
- # No geometry value used for F expression, substitue in
+ # No geometry value used for F expression, substitute in
# the column name instead.
return placeholder % self.get_expression_column(value)
else:
@@ -51,7 +51,7 @@ def get_field_type(self, data_type, description):
if not self.postgis_types_reverse:
# If the PostGIS types reverse dictionary is not populated, do so
# now. In order to prevent unnecessary requests upon connection
- # intialization, the `data_types_reverse` dictionary is not updated
+ # initialization, the `data_types_reverse` dictionary is not updated
# with the PostGIS custom types until introspection is actually
# performed -- in other words, when this function is called.
self.postgis_types_reverse = self.get_postgis_types()
@@ -290,7 +290,7 @@ def convert_extent(self, box):
def convert_extent3d(self, box3d):
"""
Returns a 6-tuple extent for the `Extent3D` aggregate by converting
- the 3d bounding-box text returnded by PostGIS (`box3d` argument), for
+ the 3d bounding-box text returned by PostGIS (`box3d` argument), for
example: "BOX3D(-90.0 30.0 1, -85.0 40.0 2)".
"""
ll, ur = box3d[6:-1].split(',')
@@ -342,7 +342,7 @@ def get_distance(self, f, dist_val, lookup_type):
This is the most complex implementation of the spatial backends due to
what is supported on geodetic geometry columns vs. what's available on
projected geometry columns. In addition, it has to take into account
- the newly introduced geography column type introudced in PostGIS 1.5.
+ the geography column type newly introduced in PostGIS 1.5.
"""
# Getting the distance parameter and any options.
if len(dist_val) == 1:
@@ -561,7 +561,7 @@ def spatial_aggregate_sql(self, agg):
"""
agg_name = agg.__class__.__name__
if not self.check_aggregate_support(agg):
- raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name)
+ raise NotImplementedError('%s spatial aggregate is not implemented for this backend.' % agg_name)
agg_name = agg_name.lower()
if agg_name == 'union':
agg_name += 'agg'
@@ -116,7 +116,7 @@ def load_spatialite_sql(self):
def spatialite_init_file(self):
# SPATIALITE_SQL may be placed in settings to tell GeoDjango
- # to use a specific path to the SpatiaLite initilization SQL.
+ # to use a specific path to the SpatiaLite initialization SQL.
return getattr(settings, 'SPATIALITE_SQL',
'init_spatialite-%s.%s.sql' %
self.connection.ops.spatial_version[:2])
@@ -233,7 +233,7 @@ def transform_value(value, srid):
placeholder = '%s(%%s, %s)' % (self.transform, f.srid)
else:
placeholder = '%s'
- # No geometry value used for F expression, substitue in
+ # No geometry value used for F expression, substitute in
# the column name instead.
return placeholder % self.get_expression_column(value)
else:
@@ -310,7 +310,7 @@ def spatial_aggregate_sql(self, agg):
"""
agg_name = agg.__class__.__name__
if not self.check_aggregate_support(agg):
- raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name)
+ raise NotImplementedError('%s spatial aggregate is not implemented for this backend.' % agg_name)
agg_name = agg_name.lower()
if agg_name == 'union':
agg_name += 'agg'
@@ -73,7 +73,7 @@ def centroid(self, **kwargs):
def collect(self, **kwargs):
"""
Performs an aggregate collect operation on the given geometry field.
- This is analagous to a union operation, but much faster because
+ This is analogous to a union operation, but much faster because
boundaries are not dissolved.
"""
return self._spatial_aggregate(aggregates.Collect, **kwargs)
@@ -137,7 +137,7 @@ def force_rhr(self, **kwargs):
def geojson(self, precision=8, crs=False, bbox=False, **kwargs):
"""
- Returns a GeoJSON representation of the geomtry field in a `geojson`
+ Returns a GeoJSON representation of the geometry field in a `geojson`
attribute on each element of the GeoQuerySet.
The `crs` and `bbox` keywords may be set to True if the user wants
@@ -21,7 +21,7 @@ def get_columns(self, with_aliases=False):
If 'with_aliases' is true, any column names that are duplicated
(without the table names) are given unique aliases. This is needed in
- some cases to avoid ambiguitity with nested queries.
+ some cases to avoid ambiguity with nested queries.
This routine is overridden from Query to handle customized selection of
geometry columns.
@@ -21,7 +21,7 @@ def georss_coords(self, coords):
def add_georss_point(self, handler, coords, w3c_geo=False):
"""
Adds a GeoRSS point with the given coords using the given handler.
- Handles the differences between simple GeoRSS and the more pouplar
+ Handles the differences between simple GeoRSS and the more popular
W3C Geo specification.
"""
if w3c_geo:
@@ -12,7 +12,7 @@
# Helper routines for retrieving pointers and/or values from
# arguments passed in by reference.
def arg_byref(args, offset=-1):
- "Returns the pointer argument's by-refernece value."
+ "Returns the pointer argument's by-reference value."
return args[offset]._obj.value
@@ -56,8 +56,8 @@ def check_string(result, func, cargs, offset=-1, str_result=False):
ptr = ptr_byref(cargs, offset)
# Getting the string value
s = ptr.value
- # Correctly freeing the allocated memory beind GDAL pointer
- # w/the VSIFree routine.
+ # Correctly freeing the allocated memory behind GDAL pointer
+ # with the VSIFree routine.
if ptr:
lgdal.VSIFree(ptr)
return s
@@ -131,7 +131,7 @@ def check_str_arg(result, func, cargs):
"""
This is for the OSRGet[Angular|Linear]Units functions, which
require that the returned string pointer not be freed. This
- returns both the double and tring values.
+ returns both the double and string values.
"""
dbl = result
ptr = cargs[-1]._obj
@@ -120,7 +120,7 @@ def __getitem__(self, target):
0
>>> print(srs['UNIT|AUTHORITY']) # For the units authority, have to use the pipe symbole.
EPSG
- >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the untis
+ >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units
9122
"""
if isinstance(target, tuple):
@@ -20,7 +20,7 @@ def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
- "Testing Envelope initilization."
+ "Testing Envelope initialization."
e1 = Envelope((0, 0, 5, 5))
Envelope(0, 0, 5, 5)
Envelope(0, '0', '5', 5) # Thanks to ww for this
@@ -300,7 +300,7 @@ def test09a_srs(self):
self.assertEqual(4269, mpoly.srid)
self.assertEqual('NAD83', mpoly.srs.name)
- # Incrementing through the multipolyogn after the spatial reference
+ # Incrementing through the multipolygon after the spatial reference
# has been re-assigned.
for poly in mpoly:
self.assertEqual(mpoly.srs.wkt, poly.srs.wkt)
@@ -192,7 +192,7 @@ def country_name(self, query):
def country(self, query):
"""
- Returns a dictonary with with the country code and name when given an
+ Returns a dictionary with with the country code and name when given an
IP address or a Fully Qualified Domain Name (FQDN). For example, both
'24.124.1.80' and 'djangoproject.com' are valid parameters.
"""
@@ -56,7 +56,7 @@ class GeoIPTag(Structure):
def check_record(result, func, cargs):
if result:
# Checking the pointer to the C structure, if valid pull out elements
- # into a dicionary.
+ # into a dictionary.
rec = result.contents
record = dict((fld, getattr(rec, fld)) for fld, ctype in rec._fields_)
Oops, something went wrong.

0 comments on commit 0d91225

Please sign in to comment.