Skip to content

Commit

Permalink
Add rtype to routes doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hfaran committed Dec 21, 2013
1 parent 1019def commit 5b19ef8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tornado_json/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def get_routes(package):
:param package: The package containing RequestHandlers to generate
routes from
:returns: List of routes for all submodules of `package`
:rtype: [(url, RequestHandler), ... ]
"""
return list(chain(*[get_module_routes(modname) for modname in
gen_submodule_names(package)]))
Expand All @@ -26,6 +27,7 @@ def gen_submodule_names(package):
:type package: package
:param package: The package to get submodule names of
:returns: Iterator that yields names of all submodules of `package`
:rtype: Iterator that yields `str`
"""
for importer, modname, ispkg in pkgutil.walk_packages(
path=package.__path__,
Expand All @@ -49,6 +51,7 @@ def get_module_routes(
For example, a requesthandler with the name
`helloworld.api.HelloWorldHandler` would be assigned the url
`/api/helloworld`
:rtype: [(url, RequestHandler), ... ]
:type module_name: str
:param module_name: Name of the module to get routes for
:type custom_routes: [(str, RequestHandler), ... ]
Expand Down

0 comments on commit 5b19ef8

Please sign in to comment.