[Zope-CMF] Re: Tools as local utilities

Rocky Burt rocky at serverzen.com
Sun Nov 19 11:39:10 EST 2006


On Sun, 2006-19-11 at 14:37 +0100, Jens Vagelpohl wrote:
> Using just the ActionsTool right now in order to get that all set up  
> and then move to the other tools, I've gotten almost always there,  
> but there is one set of tests that refuse to run right now, the ones  
> in CMFCore.exportimport.tests.test_actions which derive from class  
> _ActionSetup.
> 
> Here's the change I have made in the actions importer code so far:

<snipping some code...>

>       """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?  Looks
great.  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
automatically no?

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-cmf/attachments/20061119/944e8fb0/attachment.bin


More information about the Zope-CMF mailing list