From 5683dd09f827774b18d9533994e2c625b6c08cce Mon Sep 17 00:00:00 2001 From: Evan Simpson Date: Tue, 8 Jul 2003 18:27:45 +0000 Subject: [PATCH] Provide traceback supplements for DTML Methods and Documents. --- TracebackSupplement.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 TracebackSupplement.py diff --git a/TracebackSupplement.py b/TracebackSupplement.py new file mode 100644 index 0000000..dae6172 --- /dev/null +++ b/TracebackSupplement.py @@ -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 'Physical Path:%s' % (escape(self.pp)) + else: + return ' - Physical Path: %s' % self.pp