[Zope-Coders] ZTUtils.Tree.TreeMaker enhancement in 2.6, 2.5?

Martijn Pieters mj@zope.com
Mon, 7 Oct 2002 10:28:11 -0400


Hi all,

Those who follow the Zope checkins lists may have seen I have been working
on the ZTUtils.Tree package, fixing some items, adding tests, and, on the
Zope HEAD, adding some additional features.

On the HEAD, there are basically two new features for TreeMaker:

- Attributes that start with an underscore, which influence how the tree
  gets built, have been given setter methods so they can be changed from
  PythonScripts.

- Through the new setStateFunction call, one can now instruct the TreeMaker
  to ask an arbitrary function, for each node constructed, what that
  function thinks the state for that function should be. The function is
  passed in the current object, what state the TreeMaker has determined the
  node should be in, and the returned result of the function is used for the
  actual state.

The latter functionality allows you to set the state of any node to open
(children will be processed), closed, and leaf node. This is far far easier
than using an expansion map, which requires knowledge about the whole tree
in advance and internal knowledge of how TreeMaker distinguishes between
nodes.

I would like to merge back at least the state function functionality to 2.6
(and maybe 2.5 as well if there is demand). I need this functionality for a
customer engagement, although I can always monkey-patch the Zope
installation. Thanks to the tests I added (already available in 2.5 and
2.6), I am 100% confident that the new functionality does not break existing
functionality.

Please let me know your thoughts on this. A +1 if you agree (optinally
qualified with Zope branch numbers) would do, and I'd appreciate motivation
if you deem this -1.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@zope.com
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------