Author: gjm
Date: Thu Apr 19 15:26:07 2012
New Revision: 1327995
URL: http://svn.apache.org/viewvc?rev=1327995&view=rev
Log:
multiproduct: improvements for product path matching including updating request
with arguments from passed on requests
Modified:
incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
Modified:
incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
URL:
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py?rev=1327995&r1=1327994&r2=1327995&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
(original)
+++ incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
Thu Apr 19 15:26:07 2012
@@ -22,7 +22,7 @@ Provides request filtering to capture pr
"""
import re
-from trac.core import Component, implements
+from trac.core import Component, implements, TracError
from trac.resource import ResourceNotFound
from trac.util.translation import _
from trac.web.api import IRequestFilter, IRequestHandler, Request, HTTPNotFound
@@ -43,7 +43,9 @@ class ProductModule(Component):
pid = None
match = PRODUCT_RE.match(req.path_info)
if match:
- dispatcher = RequestDispatcher(self.env)
+ dispatcher = self.env[RequestDispatcher]
+ if dispatcher is None:
+ raise TracError('Unable to load RequestDispatcher.')
pid = match.group('pid')
if pid:
@@ -63,6 +65,7 @@ class ProductModule(Component):
for hndlr in dispatcher.handlers:
if hndlr is not self and hndlr.match_request(newreq):
new_handler = hndlr
+ req.args.update(newreq.args)
break
if new_handler is None:
if req.path_info.endswith('/'):