Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix a few typos #909

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Q: *Can I use Hug with a web framework -- Django for example?*

A: You can use Hug alongside Django or the web framework of your choice, but it does have drawbacks. You would need to run hug on a separate, hug-exclusive server. You can also [mount Hug as a WSGI app](https://pythonhosted.org/django-wsgi/embedded-apps.html), embedded within your normal Django app.

Q: *Is Hug compatabile with Python 2?*
Q: *Is Hug compatible with Python 2?*

A: Python 2 is not supported by Hug. However, if you need to account for backwards compatability, there are workarounds. For example, you can wrap the decorators:

Expand Down
4 changes: 2 additions & 2 deletions documentation/OUTPUT_FORMATS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Finally, an output format may be a collection of different output formats that g
suffix_output = hug.output_format.suffix({'.js': hug.output_format.json,
'.html': hug.output_format.html})

@hug.get(('my_endpoint.js', 'my_endoint.html'), output=suffix_output)
@hug.get(('my_endpoint.js', 'my_endpoint.html'), output=suffix_output)
def my_endpoint():
return ''

In this case, if the endpoint is accessed via my_endpoint.js, the output type will be JSON; however if it's accessed via my_endoint.html, the output type will be HTML.
In this case, if the endpoint is accessed via my_endpoint.js, the output type will be JSON; however if it's accessed via my_endpoint.html, the output type will be HTML.

You can also change the default output format globally for all APIs with either:

Expand Down
2 changes: 1 addition & 1 deletion hug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Hug's Design Objectives:

- Make developing a Python driven API as succint as a written definition.
- Make developing a Python driven API as succinct as a written definition.
- The framework should encourage code that self-documents.
- It should be fast. Never should a developer feel the need to look somewhere else for performance reasons.
- Writing tests for APIs written on-top of Hug should be easy and intuitive.
Expand Down
4 changes: 2 additions & 2 deletions hug/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def http(self, *args, **kwargs):
return http(*args, **kwargs)

def urls(self, *args, **kwargs):
"""DEPRECATED: for backwords compatibility with < hug 2.2.0. `API.http` should be used instead.
"""DEPRECATED: for backwards compatibility with < hug 2.2.0. `API.http` should be used instead.

Starts the process of building a new URL HTTP route linked to this API instance
"""
Expand Down Expand Up @@ -240,5 +240,5 @@ def put_post(self, *args, **kwargs):

object = Object()

# DEPRECATED: for backwords compatibility with hug 1.x.x
# DEPRECATED: for backwards compatibility with hug 1.x.x
call = http
2 changes: 1 addition & 1 deletion hug/store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""hug/store.py.

A collecton of native stores which can be used with, among others, the session middleware.
A collection of native stores which can be used with, among others, the session middleware.

Copyright (C) 2016 Timothy Edmund Crosley

Expand Down
2 changes: 1 addition & 1 deletion hug/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def __call__(self, value):


class Mapping(OneOf):
"""Ensures the value is one of an acceptable set of values mapping those values to a Python equivelent"""
"""Ensures the value is one of an acceptable set of values mapping those values to a Python equivalent"""

__slots__ = ("value_map",)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_greater_than():


def test_multiple():
"""Tests that hug's multile type correctly forces values to come back as lists, but not lists of lists"""
"""Tests that hug's multiple type correctly forces values to come back as lists, but not lists of lists"""
assert hug.types.multiple("value") == ["value"]
assert hug.types.multiple(["value1", "value2"]) == ["value1", "value2"]

Expand Down