[Zope-CMF] Re: Tools as local utilities

Jens Vagelpohl jens at dataflake.org
Mon Nov 13 17:20:04 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 13 Nov 2006, at 22:35, Tres Seaver wrote:
>> My new handler for the component registry is all set up and
>> registered correctly, and the "various" import step that calls
>> importVarious is set as a dependency for the component registry
>> import step. The dependency works, it is indeed run right before my
>> new step. However, registration fails, because a call to
>> zope.app.component.hooks.getSite in my component registry setup
>> handler returns None, as if the registration in importVarious had not
>> been done. When re-running all steps manually from the setup tool
>> afterwards it magically works and the component registry is  
>> populated...
>
> Perhaps the thread-local site hook needs to be set first, before  
> trying
> to use the site manager?

That would make entirely too much sense. Damn, foiled again ;)

Adding a call to zope.app.component.hooks.setSite and passing in the  
CMF site after the other magic in importVarious solved the problem.  
Thanks!

jens



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFWO+WRAx5nvEhZLIRAgZUAJwJoogy1qmfAhD1pzXYk7J2lHCfkwCePTnO
WWaxgCL+/CHHcKs1BAfYsJg=
=Vw1F
-----END PGP SIGNATURE-----


More information about the Zope-CMF mailing list