Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide traceback supplements for DTML Methods and Documents.
- Loading branch information
Evan Simpson
committed
Jul 8, 2003
1 parent
7203dae
commit 5683dd0
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 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 |