[Zope-Checkins] CVS: Packages/OFS - SimpleItem.py:1.90.4.1
Evan Simpson
evan@zope.com
Tue, 7 Aug 2001 13:18:17 -0400
Update of /cvs-repository/Packages/OFS
In directory cvs.zope.org:/tmp/cvs-serv29318
Modified Files:
Tag: Zope-2_4-branch
SimpleItem.py
Log Message:
Allow standard_error_message to be something other than DTML (like a
Script or Template).
=== Packages/OFS/SimpleItem.py 1.90 => 1.90.4.1 ===
client = client.aq_parent
s=getattr(client, 'standard_error_message')
- v=HTML.__call__(s, client, REQUEST, error_type=error_type,
- error_value=error_value,
- error_tb=error_tb,error_traceback=error_tb,
- error_message=error_message)
+ kwargs = {'error_type': error_type,
+ 'error_value': error_value,
+ 'error_tb': error_tb,
+ 'error_traceback': error_tb,
+ 'error_message': error_message}
+ if isinstance(s, HTML):
+ v = s(client, REQUEST, **kwargs)
+ elif callable(s):
+ v = s(**kwargs)
+ else:
+ v = HTML.__call__(s, client, REQUEST, **kwargs)
except: v = error_value or "Sorry, an error occurred"
raise error_type, v, tb
finally: