--- e:\BaseRequest.py Mon Dec 02 10:31:40 2002 +++ BaseRequest.py Mon Dec 02 10:33:04 2002 @@ -10,7 +10,7 @@ # FOR A PARTICULAR PURPOSE # ############################################################################## -__version__='$Revision: 1.49.4.7 $'[11:-2] +__version__='$Revision: 1.50 $'[11:-2] from urllib import quote import xmlrpc @@ -252,8 +252,10 @@ path = request.path = request['TraversalRequestNameStack'] # Check for method: + _default = 0 if path: entry_name = path.pop() + _default = 1 elif hasattr(object, '__browser_default__'): # If we have reached the end of the path. We look to see # if the object implements __browser_default__. If so, we @@ -262,21 +264,28 @@ # (usually self) and a sequence of names to traverse to # find the method to be published. (Casey) request._hacked_path=1 + _default = 1 object, default_path = object.__browser_default__(request) if len(default_path) > 1: path = list(default_path) method = path.pop() request['TraversalRequestNameStack'] = path continue - else: + elif len(default_path) > 0: method = default_path[0] entry_name = method + else: + # this means __browser_default__ had no + # idea what to do with this thing + _default = 0 elif (method and hasattr(object,method) and entry_name != method and getattr(object, method) is not None): + _default = 1 request._hacked_path=1 entry_name = method - else: + + if not _default: if (hasattr(object, '__call__') and hasattr(object.__call__,'__roles__')): roles=object.__call__.__roles__ @@ -284,6 +293,7 @@ i=URL.rfind('/') if i > 0: response.setBase(URL[:i]) break + if not entry_name: continue step = quote(entry_name) _steps.append(step)