[Zope-CMF] Patch for more forward-compatible APB
Sidnei da Silva
sidnei@x3ng.com
Fri, 18 Apr 2003 14:05:30 -0300
On Fri, Apr 18, 2003 at 12:04:15PM -0400, Tres Seaver wrote:
| I don't mind the parts of the patch which surface the "readable" bits of
| a dict; however, I don't think I want to encourage anybody to assume
| that modifying the object through '__setitem__' / 'update' is
| supported. Does Plone actually need that, or were you just being
| thorough?
For __setitem__ yes. There is some code in Plone and other products
that does:
actions = types_tool._cloneActions()
for action in actions:
if action['id'] == 'view':
action['action'] = 'folder_listing'
types_tool._actions = tuple(actions)
(or something to that effect).
Notice that im restricting the values that can be read and set to a
small set ( _props ), and that __setitem__ behaves differently for
'action', because it needs special treatment when being set.
| > In the way, I also added a few __traceback_info__ to make debugging
| > easier.
|
| Yep, no problem there.
|
| BTW, I vastly prefer to read unified diff. My ~/.cvsrc looks like:
|
| $ cat .cvsrc
| -z7
| diff -u
Hey, nice tip!
--
Sidnei da Silva (dreamcatcher) <sidnei@x3ng.com.br>
X3ng Web Technology <http://www.x3ng.com.br>
GNU/Linux user 257852
Debian GNU/Linux 3.0 (Sid) 2.4.18 ppc
The bogosity meter just pegged.