restored accidentally degraded doc string

This commit is contained in:
Tim Mundt 2016-12-16 18:51:44 +01:00
parent a550b5c112
commit 234a7925c6
2 changed files with 10 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class Config(dict):
def from_pyfile(self, filename): def from_pyfile(self, filename):
"""Updates the values in the config from a Python file. Only the uppercase """Updates the values in the config from a Python file. Only the uppercase
varibales in that module are stored in the config. variables in that module are stored in the config.
:param filename: an absolute path to the config file :param filename: an absolute path to the config file
""" """
module = types.ModuleType('config') module = types.ModuleType('config')

View File

@ -31,11 +31,17 @@ class Router:
@sanic.route('/my/url/<my_parameter>', methods=['GET', 'POST', ...]) @sanic.route('/my/url/<my_parameter>', methods=['GET', 'POST', ...])
def my_route(request, my_parameter): def my_route(request, my_parameter):
do stuff... do stuff...
or
@sanic.route('/my/url/<my_paramter>:type', methods['GET', 'POST', ...])
def my_route_with_type(request, my_parameter):
do stuff...
Parameters will be passed as keyword arguments to the request handling Parameters will be passed as keyword arguments to the request handling
function provided Parameters can also have a type by appending :type to function. Provided parameters can also have a type by appending :type to
the <parameter>. If no type is provided, a string is expected. A regular the <parameter>. Given parameter must be able to be type-casted to this.
expression can also be passed in as the type If no type is provided, a string is expected. A regular expression can
also be passed in as the type. The argument given to the function will
always be a string, independent of the type.
""" """
routes_static = None routes_static = None
routes_dynamic = None routes_dynamic = None