Skip to content

Commit

Permalink
Use new crank0.7 dispatching options
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Dec 7, 2013
1 parent 253c48b commit d2cae73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ python:
- "3.3"

install:
- "pip install git+git://github.com/TurboGears/crank.git"
- "pip install git+git://github.com/TurboGears/backlash.git"
- "pip install repoze.who"
- "pip install coverage"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

install_requires=[
'WebOb >= 1.2',
'crank >= 0.6.2',
'crank >= 0.7.0',
'Beaker',
'decorator',
'PasteDeploy',
Expand Down
9 changes: 7 additions & 2 deletions tg/controllers/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ def _get_dispatchable(self, thread_locals, url_path):
"""
req = thread_locals.request
conf = thread_locals.config

enable_request_extensions = not conf.get('disable_request_extensions', False)
dispatch_path_translator = conf.get('dispatch_path_translator', True)

params = req.args_params
state = DispatchState(weakref.proxy(req), self, params, url_path.split('/'),
conf.get('ignore_parameters', []))
conf.get('ignore_parameters', []),
strip_extension=enable_request_extensions,
path_translator=dispatch_path_translator)
url_path = state.path # Get back url_path as crank performs some cleaning

if not conf.get('disable_request_extensions', False):
if enable_request_extensions:
ext = state.extension
if ext is not None:
ext = '.' + ext
Expand Down

0 comments on commit d2cae73

Please sign in to comment.