|
|
Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: Re: Intids missing adapter declarations? - msg#00096
List: web.zope.z3base.five
Jean-Marc Orliaguet wrote:
> I had to add this to my configure.zcml file to get IntIds running:
[snip]
Or you could just have done <include package="zope.app.keyreference" /> :)
Five doesn't load every single bit of ZCML that Zope 3 provides. Mostly
because this might open cans of worms. So before someone hasn't tested
it, we won't include it.
It is pretty safe to just include the packages you need from your
package. You don't need Five to include it.
Philipp
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Intids missing adapter declarations?
Hi,
I had to add this to my configure.zcml file to get IntIds running:
<adapter
for="persistent.interfaces.IPersistent"
provides="zope.app.keyreference.interfaces.IKeyReference"
factory="zope.app.keyreference.persistent.KeyReferenceToPersistent"
trusted="y"
/>
<class class="zope.app.keyreference.persistent.KeyReferenceToPersistent">
<require permission="zope.Public"
interface="zope.app.keyreference.interfaces.IKeyReference" />
</class>
<adapter
for="persistent.interfaces.IPersistent"
provides="ZODB.interfaces.IConnection"
factory="zope.app.keyreference.persistent.connectionOfPersistent"
/>
Otherwise I'd get:
File
"/home/jmo/philikon-local-components/lib/python/zope/app/intid/__init__.py",
line 110, in register
key = IKeyReference(ob)
File
"/home/jmo/philikon-local-components/lib/python/zope/interface/interface.py",
line 691, in __call__
raise TypeError("Could not adapt", obj, self)
TypeError: ('Could not adapt', Theme('A theme'), <InterfaceClass
zope.app.keyreference.interfaces.IKeyReference>)
ref: http://svn.z3lab.org/trac/z3lab/file/CPSSkins4Five/trunk/configure.zcml
cheers
/JM
Next Message by Date:
click to view message preview
Re: [z3-five] Re: Patch for testbrowser.py
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Winkler wrote:
> On Fri, Apr 21, 2006 at 04:07:43PM +0200, Daniel Nouri wrote:
>
>>The relevant code in Zope2's ZPublisher.HTTPResponse.__str__:
>>
>> # ... we just built a headersl list using self.heders
>> if self.cookies:
>> headersl = headersl+self._cookie_list()
>> headersl[len(headersl):] = [self.accumulated_headers, body]
>> return '\n'.join(headersl)
>>
>>Maybe this can shed some light on whether we want to include that patch.
>
>
> As an aside:
>
> What's with assigning to headersl[len(headersl):] instead of calling
> headersl.extend(...)?
>
> I've seen this idiom a couple of times and I always wonder
> why, it's much less readable IMO.
>
> I doubt it's supposed to be an optimization, since this code runs only
> once per request; anyway, the two idioms are about equivalent in speed
> AFAICT.
>
> If it were in a performance-sensitive loop, a bit faster
> and still quite readable would be:
>
> headersl += [self.accumulated_headers, body]
>
> timeit confirms this, here on python 2.4.2:
I think this may be a fossil from a much earlier version of Python, in
which 'list.extend' had undesirable performance (the new one is
O(1)-amortized, I think).
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver@xxxxxxxxxxxxx
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
iD8DBQFESVJ5+gerLs4ltQ4RAlseAKDVL5ABbRYGSzNtaLUVeu37WPTBCwCfW9pp
c1gst1YN+xssxW2ZFhHWt88=
=bcvP
-----END PGP SIGNATURE-----
Previous Message by Thread:
click to view message preview
Intids missing adapter declarations?
Hi,
I had to add this to my configure.zcml file to get IntIds running:
<adapter
for="persistent.interfaces.IPersistent"
provides="zope.app.keyreference.interfaces.IKeyReference"
factory="zope.app.keyreference.persistent.KeyReferenceToPersistent"
trusted="y"
/>
<class class="zope.app.keyreference.persistent.KeyReferenceToPersistent">
<require permission="zope.Public"
interface="zope.app.keyreference.interfaces.IKeyReference" />
</class>
<adapter
for="persistent.interfaces.IPersistent"
provides="ZODB.interfaces.IConnection"
factory="zope.app.keyreference.persistent.connectionOfPersistent"
/>
Otherwise I'd get:
File
"/home/jmo/philikon-local-components/lib/python/zope/app/intid/__init__.py",
line 110, in register
key = IKeyReference(ob)
File
"/home/jmo/philikon-local-components/lib/python/zope/interface/interface.py",
line 691, in __call__
raise TypeError("Could not adapt", obj, self)
TypeError: ('Could not adapt', Theme('A theme'), <InterfaceClass
zope.app.keyreference.interfaces.IKeyReference>)
ref: http://svn.z3lab.org/trac/z3lab/file/CPSSkins4Five/trunk/configure.zcml
cheers
/JM
Next Message by Thread:
click to view message preview
[ANN] CPSSkins4Five and CPS4/Z3ECM Paris sprint report
Hi!
I've written a report on the work I did during the CPS4/Z3ECM sprint i
Paris:
http://www.z3lab.org/sections/blogs/jean-marc-orliaguet/2006_04_23_cps4-z3ecm-paris-sprint
there is also a new zope2 product called CPSSkins4Five for running
cpsskins (for zope3) on zope2 .
http://svn.z3lab.org/trac/z3lab/browser/CPSSkins4Five/trunk/
here is an animation too:
http://www.z3lab.org/sections/front-page/design-features/cpsskins4five-preview
all this is very experimental and requires branches that haven't been
merged into zope2/zope3/five trunks yet. But as a proof-of-concept it works.
Regards
/JM
|
|