Changeset 1071
- Timestamp:
- 04/25/06 11:59:41
- Files:
-
- trunk/cherrypy/_cputil.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cputil.py
r1070 r1071 9 9 from cherrypy.lib import httptools 10 10 11 def get_object_trail(objectpath=None): 12 """ 13 List of (name, object) pairs, from cherrypy.root to the current object.11 12 def get_object_trail(objectpath=None, root=None): 13 """List of (name, object) pairs, from root (cherrypy.root) down objectpath. 14 14 15 15 If any named objects are unreachable, (name, None) pairs are used. … … 39 39 return [('root', cherrypy.root), ('global_', gh), ('index', None)] 40 40 41 nameList = ['root'] + nameList + ['index'] 41 if root is None: 42 root = getattr(cherrypy, 'root', None) 43 if root is None: 44 return [('root', None), ('index', None)] 45 46 nameList.append('index') 42 47 43 48 # Convert the list of names into a list of objects 44 node = cherrypy49 node = root 45 50 objectTrail = [] 46 51 for name in nameList:

