[Zope-Checkins] CVS: Zope/lib/python/zExceptions - TracebackSupplement.py:1.1.2.1
Chris McDonough
chrism@zope.com
Mon, 21 Jul 2003 12:38:41 -0400
Update of /cvs-repository/Zope/lib/python/zExceptions
In directory cvs.zope.org:/tmp/cvs-serv17213/lib/python/zExceptions
Added Files:
Tag: Zope-2_7-branch
TracebackSupplement.py
Log Message:
Merge changes from HEAD since the release of Zope 2.7a1 into the Zope-2_7-branch in preparation for release of Zope 2.7b1.
=== Added File Zope/lib/python/zExceptions/TracebackSupplement.py ===
# Stock __traceback_supplement__ implementations
class PathTracebackSupplement:
"""Implementation of ITracebackSupplement"""
pp = None
def __init__(self, object):
self.object = object
if hasattr(object, 'getPhysicalPath'):
self.pp = '/'.join(object.getPhysicalPath())
if hasattr(object, 'absolute_url'):
self.source_url = '%s/manage_main' % object.absolute_url()
def getInfo(self, as_html=0):
if self.pp is None:
return
if as_html:
from cgi import escape
return '<b>Physical Path:</b>%s' % (escape(self.pp))
else:
return ' - Physical Path: %s' % self.pp