Skip to content

Commit

Permalink
Merge branch 'fix_typos_in_comments_#996'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaiarocci committed Mar 24, 2017
2 parents 906e9ae + 2c0af53 commit 22ea4bf
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 65 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -91,6 +91,7 @@ Patches and Contributions
- Marcus Cobden
- Marica Odagaki
- Mario Kralj
- Martin Fous
- Massimo Scamarcia
- Mateusz Łoskot
- Matt Creenan
Expand Down
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -6,6 +6,7 @@ Here you can see the full list of changes between each Eve release.
Development
-----------

- Fix: docstrings typos (Martin Fous).
- Docs: explain that ``ALLOW_UNKNOWN`` can also be used to expose
the whole document as found in the database, with no explicit validation
schema. Addresses #995.
Expand Down
2 changes: 1 addition & 1 deletion eve/auth.py
Expand Up @@ -95,7 +95,7 @@ class BasicAuth(object):
.. versionchanged:: 0.4
ensure all errors returns a parseable body #366.
auth.request_auth_value replaced with getter and setter methods which
rely on flask's 'g' object, for enhanced thread-safity.
rely on flask's 'g' object, for enhanced thread-safety.
.. versionchanged:: 0.1.1
auth.request_auth_value is now used to store the auth_field value.
Expand Down
8 changes: 4 additions & 4 deletions eve/flaskapp.py
Expand Up @@ -94,7 +94,7 @@ class Eve(Flask, Events):
.. versionchanged:: 0.2
Support for additional Flask url converters.
Support for optional, custom json encoder class.
Support for endpoint-level authenticatoin classes.
Support for endpoint-level authentication classes.
New method Eve.register_resource() for registering new resource after
initialization of Eve object. This is needed for simpler initialization
API of all ORM/ODM extensions.
Expand Down Expand Up @@ -345,7 +345,7 @@ def _validate_resource_settings(self, resource, settings):

def validate_roles(self, directive, candidate, resource):
""" Validates that user role directives are syntactically and formally
adeguate.
adequate.
:param directive: either 'allowed_[read_|write_]roles' or
'allow_item_[read_|write_]roles'.
Expand Down Expand Up @@ -552,7 +552,7 @@ def _set_resource_defaults(self, resource, settings):
'resource_title',
'default_sort',
'embedded_fields'.
Support for endpoint-level authenticatoin classes.
Support for endpoint-level authentication classes.
"""
settings.setdefault('url', resource)
settings.setdefault('resource_methods',
Expand Down Expand Up @@ -799,7 +799,7 @@ def _add_resource_url_rules(self, resource, settings):
view_func=item_endpoint,
methods=settings['item_methods'] + ['OPTIONS'])
if 'PATCH' in settings['item_methods']:
# support for POST with X-HTTM-Method-Override header for
# support for POST with X-HTTP-Method-Override header for
# clients not supporting PATCH. Also see item_endpoint() in
# endpoints.py
endpoint = resource + "|item_post_override"
Expand Down
4 changes: 2 additions & 2 deletions eve/io/base.py
Expand Up @@ -125,7 +125,7 @@ def find(self, resource, req, sub_resource_lookup):
:param req: an instance of ``eve.utils.ParsedRequest``. This contains
all the constraints that must be fulfilled in order to
satisfy the original request (where and sort parts, paging,
etc). Be warned that `where` and `sort` expresions will
etc). Be warned that `where` and `sort` expressions will
need proper parsing, according to the syntax that you want
to support with your driver. For example ``eve.io.Mongo``
supports both Python and Mongo-like query syntaxes.
Expand Down Expand Up @@ -299,7 +299,7 @@ def is_empty(self, resource):
""" Returns True if the collection is empty; False otherwise. While
a user could rely on self.find() method to achieve the same result,
this method can probably take advantage of specific datastore features
to provide better perfomance.
to provide better performance.
Don't forget, a 'resource' could have a pre-defined filter. If that is
the case, it will have to be taken into consideration when performing
Expand Down
2 changes: 1 addition & 1 deletion eve/io/media.py
Expand Up @@ -16,7 +16,7 @@ class MediaStorage(object):
along with a set of default behaviors that all other storage systems can
inherit or override as necessary.
..versioneadded:: 0.3
..versionadded:: 0.3
"""

def __init__(self, app=None):
Expand Down
8 changes: 4 additions & 4 deletions eve/io/mongo/geo.py
Expand Up @@ -16,10 +16,10 @@ def __init__(self, json):
try:
self['type'] = json['type']
except KeyError:
raise TypeError("Not compilant to GeoJSON")
raise TypeError("Not compliant to GeoJSON")
self.update(json)
if len(self.keys()) != 2:
raise TypeError("Not compilant to GeoJSON")
raise TypeError("Not compliant to GeoJSON")

def _correct_position(self, position):
return isinstance(position, list) and \
Expand All @@ -35,7 +35,7 @@ def __init__(self, json):
self['type'] != self.__class__.__name__:
raise TypeError
except (KeyError, TypeError):
raise TypeError("Geometry not compilant to GeoJSON")
raise TypeError("Geometry not compliant to GeoJSON")


class GeometryCollection(GeoJSON):
Expand All @@ -48,7 +48,7 @@ def __init__(self, json):
factory = factories[geometry["type"]]
factory(geometry)
except (KeyError, TypeError, AttributeError):
raise TypeError("Geometry not compilant to GeoJSON")
raise TypeError("Geometry not compliant to GeoJSON")


class Point(Geometry):
Expand Down
2 changes: 1 addition & 1 deletion eve/io/mongo/media.py
Expand Up @@ -67,7 +67,7 @@ def get(self, _id, resource=None):
""" Returns the file given by unique id. Returns None if no file was
found.
.. vesionchanged: 0.6
.. versionchanged: 0.6
Support for _id as string.
"""
if isinstance(_id, str_type):
Expand Down
6 changes: 3 additions & 3 deletions eve/io/mongo/mongo.py
Expand Up @@ -150,7 +150,7 @@ def find(self, resource, req, sub_resource_lookup):
.. versionchanged:: 0.3
Support for new _mongotize() signature.
.. versionchagend:: 0.2
.. versionchanged:: 0.2
Support for sub-resources.
Support for 'default_sort'.
Expand Down Expand Up @@ -550,7 +550,7 @@ def replace(self, resource, id_, document, original):
Custom ID_FIELD lookups would fail. See #203.
.. versionchanged:: 0.2
Don't explicitly converto ID_FIELD to ObjectId anymore, so we can
Don't explicitly convert ID_FIELD to ObjectId anymore, so we can
also process different types (UUIDs etc).
.. versionadded:: 0.1.0
Expand Down Expand Up @@ -954,7 +954,7 @@ def create_index(app, resource, name, list_of_keys, index_options):
.. versionadded:: 0.6
"""
# it doesn't work as a typical mongodb method run in the request
# life cicle, it is just called when the app start and it uses
# life cycle, it is just called when the app start and it uses
# pymongo directly.
collection = app.config['SOURCES'][resource]['source']

Expand Down
4 changes: 2 additions & 2 deletions eve/io/mongo/parser.py
Expand Up @@ -5,7 +5,7 @@
~~~~~~~~~~~~~~~~~~~
This module implements a Python-to-Mongo syntax parser. Allows the MongoDB
data-layer to seamlessy respond to a Python-like query.
data-layer to seamlessly respond to a Python-like query.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
Expand Down Expand Up @@ -66,7 +66,7 @@ def visit_Module(self, node):
# perform the magic.
self.generic_visit(node)

# if we didn't obtain a query, it is likely that an unsopported
# if we didn't obtain a query, it is likely that an unsupported
# python expression has been passed.
if self.mongo_query == {}:
raise ParseError("Only conditional statements with boolean "
Expand Down
8 changes: 4 additions & 4 deletions eve/io/mongo/validation.py
Expand Up @@ -84,7 +84,7 @@ def validate_replace(self, document, _id, original_document=None):
case we want to perform a full :func:`validate` (the new document is to
be considered a new insertion and required fields needs validation).
However, like with validate_update, we also want the current _id
not to be checked when validationg 'unique' values.
not to be checked when validating 'unique' values.
.. versionadded:: 0.1.0
"""
Expand Down Expand Up @@ -133,7 +133,7 @@ def _validate_unique(self, unique, field, value):
.. versionchanged:: 0.6
Validates field value uniqueness against the whole datasource,
indipendently of the request method. See #646.
independently of the request method. See #646.
.. versionchanged:: 0.3
Support for new 'self._error' signature introduced with Cerberus
Expand Down Expand Up @@ -286,8 +286,8 @@ def _validate_type_dbref(self, field, value):
def _validate_readonly(self, read_only, field, value):
"""
.. versionchanged:: 0.5
Not taking defaul values in consideration anymore since they are now
being resolved after validation (#353).
Not taking default values in consideration anymore since they are
now being resolved after validation (#353).
Consider the original value if available (#479).
.. versionadded:: 0.4
Expand Down
2 changes: 1 addition & 1 deletion eve/logging.py
Expand Up @@ -24,7 +24,7 @@ class RequestFilter(logging.Filter):
Note that the app.logger can also be used by callback functions.
def log_a_get(resoure, request, payload):
def log_a_get(resource, request, payload):
app.logger.info('we just responded to a GET request!')
app = Eve()
Expand Down
18 changes: 9 additions & 9 deletions eve/methods/common.py
Expand Up @@ -485,7 +485,7 @@ def normalize_dotted_fields(document):
""" Normalizes eventual dotted fields so validation can be performed
seamlessly. For example this document:
{"location.city": "a nested cisty"}
{"location.city": "a nested city"}
would be normalized to:
Expand Down Expand Up @@ -763,18 +763,18 @@ def resolve_embedded_documents(document, resource, embedded_fields):
:param resource: the resource name.
:param embedded_fields: the list of fields we are allowed to embed.
.. versionchagend:: 0.5
.. versionchanged:: 0.5
Support for embedding documents located in subdocuments.
Allocated two functions embedded_document and subdocuments.
.. versionchagend:: 0.4
.. versionchanged:: 0.4
Moved parsing of embedded fields to _resolve_embedded_fields.
Support for document versioning.
.. versionchagend:: 0.2
.. versionchanged:: 0.2
Support for 'embedded_fields'.
.. versonchanged:: 0.1.1
.. versionchanged:: 0.1.1
'collection' key has been renamed to 'resource' (data_relation).
.. versionadded:: 0.1.0
Expand Down Expand Up @@ -899,9 +899,9 @@ def store_media_files(document, resource, original=None):
.. versionadded:: 0.3
"""
# TODO We're storing media files in advance, before the corresponding
# document is also stored. In the rare occurance that the subsequent
# document is also stored. In the rare occurrence that the subsequent
# document update fails we should probably attempt a cleanup on the storage
# sytem. Easier said than done though.
# system. Easier said than done though.
for field in resource_media_fields(document, resource):
if original and field in original:
# since file replacement is not supported by the media storage
Expand Down Expand Up @@ -957,7 +957,7 @@ def resolve_sub_resource_path(document, resource):


def resolve_user_restricted_access(document, resource):
""" Adds user restricted access medadata to the document if applicable.
""" Adds user restricted access metadata to the document if applicable.
:param document: the document being posted or replaced
:param resource: the resource to which the document belongs
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def document_link(resource, document_id, version=None):

def resource_link():
""" Returns the current resource path relative to the API entry point.
Mostly going to be used by hatoeas functions when building
Mostly going to be used by hateoas functions when building
document/resource links. The resource URL stored in the config settings
might contain regexes and custom variable names, all of which are not
needed in the response payload.
Expand Down
4 changes: 2 additions & 2 deletions eve/methods/delete.py
Expand Up @@ -4,7 +4,7 @@
eve.methods.delete
~~~~~~~~~~~~~~~~~~
This module imlements the DELETE method.
This module implements the DELETE method.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
Expand Down Expand Up @@ -133,7 +133,7 @@ def deleteitem_internal(
missing_media_fields = [f for f in media_fields if f not in original]
if len(missing_media_fields):
# retrieve the whole document so we have all media fields available
# Should be very a rare occurence. We can't get rid of the
# Should be very a rare occurrence. We can't get rid of the
# get_document() call since it also deals with etag matching, which
# is still needed. Also, this lookup should never fail.
# TODO not happy with this hack. Not at all. Is there a better way?
Expand Down
14 changes: 7 additions & 7 deletions eve/methods/get.py
Expand Up @@ -48,7 +48,7 @@ def get_internal(resource, **lookup):
Support for HEADER_TOTAL_COUNT returned with response header.
.. versionchanged:: 0.5
Support for customisable query parameters.
Support for customizable query parameters.
.. versionchanged:: 0.4
Add pagination info whatever the HATEOAS status.
Expand Down Expand Up @@ -77,7 +77,7 @@ def get_internal(resource, **lookup):
Support for embeddable documents.
.. versionchanged:: 0.0.9
Event hooks renamed to be more robuts and consistent: 'on_getting'
Event hooks renamed to be more robust and consistent: 'on_getting'
renamed to 'on_fetch'.
.. versionchanged:: 0.0.8
Expand Down Expand Up @@ -159,8 +159,8 @@ def parse_aggregation_stage(d, key, value):
response[config.ITEMS] = documents

# PyMongo's CommandCursor does not return a count, so we cannot
# provide paination/total count info as we do with a normal (non-aggregate)
# GET request.
# provide pagination/total count info as we do with a normal
# (non-aggregate) GET request.

return response, None, None, 200, []

Expand Down Expand Up @@ -256,7 +256,7 @@ def getitem_internal(resource, **lookup):
Pagination links reflect current query. (#464)
.. versionchanged:: 0.4
HATOEAS link for contains the business unit value even when
HATEOAS link for contains the business unit value even when
regexes have been configured for the resource endpoint.
'on_fetched' now returns the whole response (HATEOAS metafields
included.)
Expand All @@ -268,7 +268,7 @@ def getitem_internal(resource, **lookup):
When IF_MATCH is disabled, no etag is included in the payload.
.. versionchanged:: 0.1.1
Support for Embeded Resource Serialization.
Support for Embedded Resource Serialization.
.. versionchanged:: 0.1.0
Support for optional HATEOAS.
Expand Down Expand Up @@ -473,7 +473,7 @@ def _pagination_links(resource, req, document_count, document_id=None):
Pagination links reflect current query. (#464)
.. versionchanged:: 0.4
HATOEAS link for contains the business unit value even when
HATEOAS link for contains the business unit value even when
regexes have been configured for the resource endpoint.
.. versionchanged:: 0.0.8
Expand Down
6 changes: 3 additions & 3 deletions eve/methods/patch.py
Expand Up @@ -4,7 +4,7 @@
eve.methods.patch
~~~~~~~~~~~~~~~~~
This module imlements the PATCH method.
This module implements the PATCH method.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
Expand Down Expand Up @@ -82,7 +82,7 @@ def patch_internal(resource, payload=None, concurrency_check=False,
through. Fixes #395.
.. versionchanged:: 0.4
Allow abort() to be inoked by callback functions.
Allow abort() to be invoked by callback functions.
'on_update' raised before performing the update on the database.
Support for document versioning.
'on_updated' raised after performing the update on the database.
Expand Down Expand Up @@ -120,7 +120,7 @@ def patch_internal(resource, payload=None, concurrency_check=False,
ETag is now computed without the need of an additional db lookup
.. versionchanged:: 0.0.5
Support for 'aplication/json' Content-Type.
Support for 'application/json' Content-Type.
.. versionchanged:: 0.0.4
Added the ``requires_auth`` decorator.
Expand Down

0 comments on commit 22ea4bf

Please sign in to comment.