Commit 5ea0fb23 authored by Jim Fulton's avatar Jim Fulton

Got rid of '..' test in middle of traversal, I hope.

parent 851950b8
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.6 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
from string import join, split, find, rfind, lower, upper from string import join, split, find, rfind, lower, upper
from urllib import quote from urllib import quote
...@@ -300,33 +300,30 @@ class BaseRequest: ...@@ -300,33 +300,30 @@ class BaseRequest:
"Cannot locate object at: %s" %URL) "Cannot locate object at: %s" %URL)
else: return response.notFoundError(URL) else: return response.notFoundError(URL)
if subobject is object and entry_name=='.': try:
URL=URL[:rfind(URL,'/')] try: doc=subobject.__doc__
except: doc=getattr(object, entry_name+'__doc__')
if not doc: raise AttributeError, entry_name
except:
if debug_mode:
return response.debugError("Missing doc string at: %s"
% URL)
else: return response.notFoundError("%s" % (URL))
if hasattr(subobject,'__roles__'):
roles=subobject.__roles__
else: else:
try: if not got:
try: doc=subobject.__doc__ roleshack=entry_name+'__roles__'
except: doc=getattr(object, entry_name+'__doc__') if hasattr(object, roleshack):
if not doc: raise AttributeError, entry_name roles=getattr(object, roleshack)
except:
if debug_mode: # Promote subobject to object
return response.debugError("Missing doc string at: %s"
% URL) parents.append(object)
else: return response.notFoundError("%s" % (URL)) object=subobject
if hasattr(subobject,'__roles__'): steps.append(entry_name)
roles=subobject.__roles__
else:
if not got:
roleshack=entry_name+'__roles__'
if hasattr(object, roleshack):
roles=getattr(object, roleshack)
# Promote subobject to object
parents.append(object)
object=subobject
steps.append(entry_name)
# Check for method: # Check for method:
if not path: if not path:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment