[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3 - z3.py:1.7

Magnus Heino magnus.heino@pleon.sigma.se
Tue, 26 Nov 2002 14:51:40 +0100


This is my first look at Zope3, so I will ask first, instead of trying to=
=20
fix... and I'm probably all wrong anyway ;)

> Modified Files:
> =09z3.py
> Log Message:
> Explicitly use ThreadedAsync.
>
> We need ThreadedAsync to make ZEO work with Zope.  It seems better to
> be explicit about where the code is running, so import ThreadedAsync
> instead of pretending to go through asyncore.
>
>
> =3D=3D=3D Zope3/z3.py 1.6 =3D> 1.7 =3D=3D=3D
> --- Zope3/z3.py:1.6=09Mon Nov 18 15:20:11 2002
> +++ Zope3/z3.py=09Mon Nov 25 12:07:32 2002
> @@ -17,7 +17,8 @@
>  $Id$
>  """
>
> -import os, sys, asyncore
> +import os, sys
> +import ThreadedAsync

This import or ThreadedAsync won't work, since lib/python path is setup l=
ater=20
on in the run method. I moved the import to the row before its actually u=
sed.=20

I guess you have a copy of it in site-packages or something...

>
>  basepath =3D filter(None, sys.path)
>
> @@ -57,7 +58,7 @@
>      XMLConfig(os.path.join(dir, 'zserver.zcml'))()
>
>      try:
> -        asyncore.loop()
> +        ThreadedAsync.loop()

Isn't :

import asyncore
import ThreadedAsync
asyncore.loop()=20

the way to do it? ThreadedAsync doesnt have a loop method. All it does is=
 that=20
it changes asyncore.loop.

--=20

  /Magnus