[Zope-CMF] Re: Removing default from browser:skin layers?
Tres Seaver
tseaver at palladion.com
Tue Nov 15 14:23:00 EST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Philipp von Weitershausen wrote:
> Tres, if you're experiencing the test failures with the Zope 2 trunk but
> not with Zope 2.8 branch, it might be because your stub request is
> lacking the 'default' layer. In Zope 3.1+, layers and skins are
> interfaces extending IBrowserRequest and they are directly provided on
> the request object by the skin machinery. Five tricks the Zope 2 request
> into providing the correct default skin interfaces with the following
> code in Traversable.__bobo_traverse__():
>
> from zope.app.publication.browser import setDefaultSkin
> from zope.app.interface import queryType
>
> [snip]
>
> # set the default skin on the request if it doesn't have any
> # layers set on it yet
> if queryType(REQUEST, ILayer) is None:
> setDefaultSkin(REQUEST)
>
> In order to do deal with this (e.g. in tests) in both Zope 2.8 and 2.9
> without resorting to ugly try/except clauses, Five could maybe grow a
> convenience function to do the above. It would do nothing in Five 1.2
> and the above in 1.3. It would go away for Five 1.5.
>
> Let me know if this is the case, I'll be happy to put the function into
> Five and release new betas of 1.2 and 1.3.
The error I am seeing is early, during product initialization, before
any tests are actually running:
File
"/home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/configuration/config.py",
line 1390, in toargs
args[str(name)] = field.fromUnicode(s)
File
"/home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/configuration/fields.py",
line 231, in fromUnicode
raise InvalidToken("%s in %s" % (v, u))
ZopeXMLConfigurationError: File
"/home/tseaver/projects/CMF/cmf_test/z29_cmfhead/Products/CMFDefault/configure.zcml",
line 5.2-7.6
ZopeXMLConfigurationError: File
"/home/tseaver/projects/CMF/cmf_test/z29_cmfhead/Products/CMFDefault/skin/configure.zcml",
line 11.2-14.8
ConfigurationError: ('Invalid value for', 'layers', "Couldn't import
default, No module named default in cmf default")
2005-11-15 14:05:11 ERROR Zope Couldn't install Five
That line in CMFDefault/skin/configure.zcml does:
<!-- 'default' layer breaks when run under 2.9! -->
<browser:skin
name="cmf"
layers="cmf default"
/>
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDejVm+gerLs4ltQ4RAoBHAKCpi2JEagFjOxpkJWoTtEDq6oXZTQCeKjgt
YD364vGjDmUvD4JKlBfsoEY=
=d1JJ
-----END PGP SIGNATURE-----
--
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
More information about the Zope-CMF
mailing list