Re: [Zope-Checkins] Re: [Checkins] SVN: Products.Five/trunk/ Now you can use the old registry with the new API for registerig components.
Florent Guillaume wrote: Indeed :) On 29 Jul 2006, at 00:39, Benji York wrote: Florent Guillaume wrote: On 27 Jul 2006, at 16:15, Lennart Regebro wrote: Modified: Products.Five/trunk/site/localsite.py === --- Products.Five/trunk/site/localsite.py2006-07-27 13:51:25 UTC (rev 69270) +++ Products.Five/trunk/site/localsite.py2006-07-27 14:15:46 UTC (rev 69271) @@ -16,12 +16,26 @@ $Id$ +from operator import xor +def one_of_three(a, b, c): +# Logical table for a three part test where only one can be true: +# 0 0 0: 0 +# 0 0 1: 1 +# 0 1 0: 1 +# 0 1 1: 0 +# 1 0 0: 1 +# 1 0 1: 0 +# 1 1 0: 0 +# 1 1 1: 0 +return xor(xor(a, b), c) and not (a and b and c) Heh, boolean algebra is nice but sometimes integers convey the meaning much better: return int(a)+int(b)+int(c) == 1 Hey, this is fun! How about this: def only_one(*args): return sum(bool(i) for i in args) == 1 --Benji York Senior Software Engineer Zope Corporation or even: [a, b, c].count(True) == 1 :-) /JM ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/ - fixed import errors
Log message for revision 67141: - fixed import errors Changed: U Products.Five/branches/philikon-local-components/fiveconfigure.py U Products.Five/branches/philikon-local-components/meta.zcml -=- Modified: Products.Five/branches/philikon-local-components/fiveconfigure.py === --- Products.Five/branches/philikon-local-components/fiveconfigure.py 2006-04-19 16:02:48 UTC (rev 67140) +++ Products.Five/branches/philikon-local-components/fiveconfigure.py 2006-04-19 16:06:57 UTC (rev 67141) @@ -35,7 +35,7 @@ from zope.security.interfaces import IPermission from zope.app.component.interface import provideInterface -from zope.app.component.metaconfigure import adapter +from zope.component.zcml import adapter from Products.Five import isFiveMethod from Products.Five.viewable import Viewable Modified: Products.Five/branches/philikon-local-components/meta.zcml === --- Products.Five/branches/philikon-local-components/meta.zcml 2006-04-19 16:02:48 UTC (rev 67140) +++ Products.Five/branches/philikon-local-components/meta.zcml 2006-04-19 16:06:57 UTC (rev 67141) @@ -8,6 +8,7 @@ meta:directives namespace=http://namespaces.zope.org/zope; +!-- FIXME: the definePermission handler is not found -- meta:directive name=permission schema=zope.app.security.metadirectives.IDefinePermissionDirective @@ -16,8 +17,8 @@ meta:directive name=interface -schema=zope.app.component.metadirectives.IInterfaceDirective -handler=zope.app.component.metaconfigure.interface +schema=zope.component.zcml.IInterfaceDirective +handler=zope.component.zcml.interface / meta:directive @@ -28,20 +29,20 @@ meta:directive name=adapter -schema=zope.app.component.metadirectives.IAdapterDirective -handler=zope.app.component.metaconfigure.adapter +schema=zope.component.zcml.IAdapterDirective +handler=zope.component.zcml.adapter / meta:directive name=subscriber -schema=zope.app.component.metadirectives.ISubscriberDirective -handler=zope.app.component.metaconfigure.subscriber +schema=zope.component.zcml.ISubscriberDirective +handler=zope.component.zcml.subscriber / meta:directive name=utility -schema=zope.app.component.metadirectives.IUtilityDirective -handler=zope.app.component.metaconfigure.utility +schema=zope.component.zcml.IUtilityDirective +handler=zope.component.zcml.utility / meta:directive @@ -162,14 +163,14 @@ meta:directive name=redefinePermission namespace=http://namespaces.zope.org/meta; - schema=zope.app.security.metadirectives.IRedefinePermission - handler=zope.app.security.metaconfigure.redefinePermission + schema=zope.security.zcml.IRedefinePermission + handler=zope.security.zcml.redefinePermission / !-- load the zope:modulealias directive -- include package=zope.modulealias file=meta.zcml / !-- load the i18n:registerTranslations directive -- - include package=zope.app.i18n file=meta.zcml / + include package=zope.i18n file=meta.zcml / /configure ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins