Skip to content

Commit

Permalink
fix(app module): Fixed documentation stuff, and renamed a module (#1620)
Browse files Browse the repository at this point in the history
* Fixes documentation, and renamed api_helpers module

* docs(newsfragments): tweak the API class deprecation note

* docs(newsfragments): rename extension to conform to the Towncrier standard types

* docs(newsfragments): tweak the note even further (remove one "compatibility")

* Changed deprecation class
  • Loading branch information
myusko authored and kgriffs committed Dec 16, 2019
1 parent 29a18c2 commit 8779753
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ API.
' ~ Immanuel Kant\n\n')
# falcon.API instances are callable WSGI apps
# falcon.App instances are callable WSGI apps
# in larger applications the app is created in a separate file
app = falcon.API()
app = falcon.App()
# Resources are represented by long-lived class instances
things = ThingsResource()
Expand Down Expand Up @@ -618,7 +618,7 @@ bodies.
resp.location = '/%s/things/%s' % (user_id, proper_thing['id'])
# Configure your WSGI server to load "things.app" (app is a WSGI callable)
app = falcon.API(middleware=[
app = falcon.App(middleware=[
AuthMiddleware(),
RequireJSON(),
JSONTranslator(),
Expand Down
3 changes: 3 additions & 0 deletions docs/_newsfragments/api_class.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The ``falcon.API`` class was renamed to ``falcon.App``. The old ``API`` class
remains available as an alias for backwards-compatibility, but it is now
considered deprecated and will be removed in a future release.
2 changes: 1 addition & 1 deletion docs/api/cors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Usage
import falcon
# Enable a simple CORS policy for all responses
app = falcon.API(cors_enable=True)
app = falcon.App(cors_enable=True)
6 changes: 3 additions & 3 deletions examples/look/look/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

def create_app(image_store):
image_resource = Resource(image_store)
api = falcon.API()
api.add_route('/images', image_resource)
return api
app = falcon.App()
app.add_route('/images', image_resource)
return app


def get_app():
Expand Down
2 changes: 1 addition & 1 deletion examples/things.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def on_get(self, req, resp):

# falcon.API instances are callable WSGI apps
# in larger applications the app is created in a separate file
app = falcon.API()
app = falcon.App()

# Resources are represented by long-lived class instances
things = ThingsResource()
Expand Down
2 changes: 1 addition & 1 deletion examples/things_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def on_post(self, req, resp, user_id):


# Configure your WSGI server to load "things.app" (app is a WSGI callable)
app = falcon.API(middleware=[
app = falcon.App(middleware=[
AuthMiddleware(),
RequireJSON(),
JSONTranslator(),
Expand Down
2 changes: 1 addition & 1 deletion falcon/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re
import traceback

from falcon import api_helpers as helpers, DEFAULT_MEDIA_TYPE, routing
from falcon import app_helpers as helpers, DEFAULT_MEDIA_TYPE, routing
from falcon.http_error import HTTPError
from falcon.http_status import HTTPStatus
from falcon.middlewares import CORSMiddleware
Expand Down
File renamed without changes.

0 comments on commit 8779753

Please sign in to comment.