[Zope-dev] Zope Tests: 5 OK, 2 Failed

2007-01-10 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue Jan  9 12:00:00 2007 UTC to Wed Jan 10 12:00:00 2007 UTC.
There were 7 messages: 7 from Zope Unit Tests.


Test failures
-

Subject: FAILED (failures=1) : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:15:54 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007011.html

Subject: FAILED (failures=1) : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:17:24 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007012.html


Tests passed OK
---

Subject: OK : Zope-2.6 Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:08:23 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007006.html

Subject: OK : Zope-2.6 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:09:53 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007007.html

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:11:23 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007008.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:12:53 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007009.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Jan  9 21:14:23 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-January/007010.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python

2007-01-10 Thread Dieter Maurer
I tried to use Zope3 events to get informed when requests start and end.

One of our modules (the interface module to jpype) requires such
a notification for reliable work. Therefore, it tried to register
the corresponding subscriptions on import of this module.
Unfortunately, this works very unreliably -- for the following reasons:


  The CA performs by itself only extremely minimal initialization.
  Especially, it does not register the Adapters service, necessary
  for the registration of event subscriptions.

  The full CA initialization is only performed quite late, in the call
  to Products.Five.initialize.
  Event notification registration attempts before this time will fail
  (with a ComponentLookupError: 'Adapters'), 
  those performed after this time will succeed.

The Five initialization is stupid enough that it will fail
when the service registration for 'Adapters' has already been performed.


At the current state, event notifications can reliably only be defined 
via ZCML. This is unfortunate for our use case where the registration
should be bound to the import of a given module.


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python

2007-01-10 Thread Martijn Faassen

Dieter Maurer wrote:

I tried to use Zope3 events to get informed when requests start and end.

One of our modules (the interface module to jpype) requires such
a notification for reliable work. Therefore, it tried to register
the corresponding subscriptions on import of this module.
Unfortunately, this works very unreliably -- for the following reasons:


  The CA performs by itself only extremely minimal initialization.
  Especially, it does not register the Adapters service, necessary
  for the registration of event subscriptions.

  The full CA initialization is only performed quite late, in the call
  to Products.Five.initialize.
  Event notification registration attempts before this time will fail
  (with a ComponentLookupError: 'Adapters'), 
  those performed after this time will succeed.


The Five initialization is stupid enough that it will fail
when the service registration for 'Adapters' has already been performed.


At the current state, event notifications can reliably only be defined 
via ZCML. This is unfortunate for our use case where the registration

should be bound to the import of a given module.


I'm a bit surprised why the huge [warning] is necessary. What I 
understand you're saying is that you cannot use the component 
architecture before it's done initializing. You also assert that you 
need a registration to happen at Python import time. I'm curious to hear 
more about why you need to do this - after all, you're talking about 
listening to request start and end, and this happens after import time.


With Grok we have the grok.subscribe decorator which allows us to do this:

@grok.subscribe(IFoo, IObjectModifiedEvent):
def handle(obj, event):
   ... do something ...

The decorator gets executed during import time, but it doesn't actually 
try registering anything into the CA. Instead it leaves an annotation on 
the module and these annotations are read later (at grok time, when 
everything has been initialized) to make registrations in the component 
architecture. Perhaps you can use a similar strategy. You could even try 
taking a look at how we do this in Grok.


Regards,

Martijn

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python

2007-01-10 Thread Philipp von Weitershausen

Dieter Maurer wrote:

I tried to use Zope3 events to get informed when requests start and end.

One of our modules (the interface module to jpype) requires such
a notification for reliable work. Therefore, it tried to register
the corresponding subscriptions on import of this module.


That is an uncommon approach, at least it used to be. Typically, we 
first have a bootstrap level and then we register things. During the 
bootstrap level, the Component Architecture is initialized.


Things changed a bit after Zope 2.8/X3 3.0. Nowadays, the Component 
Architecture doesn't need any setup anymore and you can do registrations 
on import. I'd still recommend against that.



Unfortunately, this works very unreliably -- for the following reasons:


  The CA performs by itself only extremely minimal initialization.
  Especially, it does not register the Adapters service, necessary
  for the registration of event subscriptions.

  The full CA initialization is only performed quite late, in the call
  to Products.Five.initialize.
  Event notification registration attempts before this time will fail
  (with a ComponentLookupError: 'Adapters'), 
  those performed after this time will succeed.


The Five initialization is stupid enough that it will fail
when the service registration for 'Adapters' has already been performed.


That's because Five assumes it's responsible for the setup layer. I 
suggest to register components through ZCML. Five will pick up 
configure.zcml in products automatically *after* everything has been set 
up properly. That's the canonical way, at least in Zope 2.8/X3 3.0


At the current state, event notifications can reliably only be defined 
via ZCML. This is unfortunate for our use case where the registration

should be bound to the import of a given module.


I typically find it quite magic when application policy things happen at 
import:


  Never mix mechanism with policy
-- Brooks' Second Law of Software Reuse

Philipp


P.S.: I agree with Martijn, the big warning is uncalled for. You're 
just trying to fight the semantics of the framework.


--
http://worldcookery.com -- Professional Zope documentation and training
2nd edition of Web Component Development with Zope 3 is now shipping!
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope 2.10.2 coming up

2007-01-10 Thread yuppie

Hi!


Philipp von Weitershausen wrote:

yuppie wrote:


The Zope 2.10 branch still uses Five 1.5.1. There are a few changes on 
the Five 1.5 branch (including a security fix) which should become 
part of Zope 2.10.2.


I volunteer to resolve this as follows:

Five releases are now linked tightly to specific Zope releases, so it 
doesn't make much sense to do still separate Five releases. See this 
thread:

http://codespeak.net/pipermail/z3-five/2006q4/001889.html

If there are no objections, I'll stitch the Five 1.5 branch HEAD 
directly into the Zope 2.10 branch (without using svn externals) and 
Five trunk HEAD into the Zope trunk. This would mean that from now on 
Five 1.5 and 1.6 are maintained as part of Zope 2. In fact there will 
be no Five 1.5.2 or 1.6 because there will no longer be any separate 
releases.


Thoughts?


+ sys.maxint



For the records:

After some more off-list discussion with Philipp I decided to move only 
the trunk. This is done now.


The 1.5 branch still exists and Philipp tagged Five 1.5.2 for Zope 2.10.2.


Cheers,

Yuppie

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope 2.10.2 coming up

2007-01-10 Thread Andreas Jung



--On 10. Januar 2007 18:28:42 +0100 yuppie [EMAIL PROTECTED] wrote:


Hi!


Philipp von Weitershausen wrote:

yuppie wrote:


The Zope 2.10 branch still uses Five 1.5.1. There are a few changes on
the Five 1.5 branch (including a security fix) which should become
part of Zope 2.10.2.

I volunteer to resolve this as follows:

Five releases are now linked tightly to specific Zope releases, so it
doesn't make much sense to do still separate Five releases. See this
thread:
http://codespeak.net/pipermail/z3-five/2006q4/001889.html

If there are no objections, I'll stitch the Five 1.5 branch HEAD
directly into the Zope 2.10 branch (without using svn externals) and
Five trunk HEAD into the Zope trunk. This would mean that from now on
Five 1.5 and 1.6 are maintained as part of Zope 2. In fact there will
be no Five 1.5.2 or 1.6 because there will no longer be any separate
releases.

Thoughts?


+ sys.maxint



For the records:

After some more off-list discussion with Philipp I decided to move only
the trunk. This is done now.

The 1.5 branch still exists and Philipp tagged Five 1.5.2 for Zope 2.10.2.





Thank you both!

Andreas

pgpfIhWVYGE40.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python

2007-01-10 Thread Dieter Maurer
Martijn Faassen wrote at 2007-1-10 11:45 +0100:
 
I'm a bit surprised why the huge [warning] is necessary. What I 
understand you're saying is that you cannot use the component 
architecture before it's done initializing.

The warning comes from bad experience.

   I have tested my registration and in my test it worked because
   Products.Five.initialize happened to be called before.
   But during real use, my module was imported before
   Products.Five.initialize has been called -- leading to strange
   and not immediately recognizable errors.

You also assert that you 
need a registration to happen at Python import time. I'm curious to hear 
more about why you need to do this

I know that the module needs to get informed about request starts.
What is more natural than registering for this event when
the module is imported?

 ... some complex delaying of registrations ...
Perhaps you can use a similar strategy.

Probably I could but it seems quite complex compared to
a slightly more complete initialization of the CA via Python
(rather then the late initialization via Five).

Moreover, I would have to find the correct time to activate
the delayed registrations. This time must be after
Products.Five.initialize is called -- and nothing specifies
the order in which products are initialized.


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python

2007-01-10 Thread Dieter Maurer
Philipp von Weitershausen wrote at 2007-1-10 15:40 +0100:
 ...
Things changed a bit after Zope 2.8/X3 3.0. Nowadays, the Component 
Architecture doesn't need any setup anymore and you can do registrations 
on import.

Very good!

I'd still recommend against that.

Why?

 ...
That's because Five assumes it's responsible for the setup layer. I 
suggest to register components through ZCML. Five will pick up 
configure.zcml in products automatically *after* everything has been set 
up properly.

The registration is necessary for the module *and not* any product.

It might be possible that any product that uses the module
registers for the event -- but it would break modularity
and would be slightly inefficient.

 ...
I typically find it quite magic when application policy things happen at 
import:

It is not application policy but a module requirement:

  *It* must be informed whenever it is used in a different thread.

  In Zope, this may be approximated via an information about
  the beginning of each request processing.

 
P.S.: I agree with Martijn, the big warning is uncalled for. You're 
just trying to fight the semantics of the framework.

That the semantics meanwhile has changed (as you note above) indicates that 
is has not really been right.
And fighting against wrong semantics is a good thing :-)

On the other hand, I agree that my fight came late as the current
release already allows what I was looking for.
Apparently, others already fought successfully...



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Zope] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python

2007-01-10 Thread Fred Drake

On 1/10/07, Dieter Maurer [EMAIL PROTECTED] wrote:

  *It* must be informed whenever it is used in a different thread.


Perhaps it could use some thread-local data to keep track of this?
threading.local comes to mind.

 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Every sin is the result of a collaboration. --Lucius Annaeus Seneca
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )