-----BEGIN PGP SIGNED MESSAGE-----
On 19 Nov 2006, at 18:59, Tres Seaver wrote:
"""Export actions tool.
site = context.getSite()
- - tool = getToolByName(site, 'portal_actions', None)
+ tool = getUtility(IActionsTool, context=site)
This looks like it will be the new way of looking up CMF tools?
For the sake of backward compatibility, I'm thinking we should
re-implement 'getToolByName' to use a map of tool name to
call 'queryUtility' using that interface; it can then fall back to an
acquired getattr and issue a deprecation warning if that fails (maybe
warn either way?)
Yes, this map is part of the change, including deprecation warning
and all. By the way, getToolByName was exposed to untrusted code used
in places like skin scripts as well - I suppose for those we need to
provide some alternative that is callable from untrusted code.
But we shouldn't have to specify ``context=site`` should we?
getUtility should automatically figure out what the nearest chain of
sites should be and look for local utilities in each one of them
That won't work unless the tests set up the thread-local site in the
same way that the publisher does.
Right - and that's most likely where I am doing something wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
-----END PGP SIGNATURE-----
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests