add documentation for path_translator and strip_extension and set default path_translator with path_translator=True

This commit is contained in:
Alessandro Molina 2013-12-07 14:13:17 +01:00
parent 7299145500
commit 17a00a0b3d
1 changed files with 8 additions and 2 deletions

View File

@ -25,11 +25,15 @@ class DispatchState(object):
parameters to pass into the dispatch state will use request.params
path_info
pre-split list of path elements, will use request.pathinfo if not used
strip_extension
Whenever crank should strip the url extension or not resolving the path
path_translator
Function used to perform path escaping when looking for controller methods,
can be None to perform no escaping or True to use default escaping function.
"""
def __init__(self, request, dispatcher=None, params=None, path_info=None,
ignore_parameters=None, strip_extension=True,
path_translator=default_path_translator):
ignore_parameters=None, strip_extension=True, path_translator=True):
path = path_info
if path is None:
path = request.path_info[1:]
@ -51,6 +55,8 @@ class DispatchState(object):
if path_translator is None:
path_translator = noop_translation
elif path_translator is True:
path_translator = default_path_translator
self.request = request
self.extension = None