[Zope-Coders] Zope tests: 8 OK

2005-08-22 Thread Zope tests summarizer
Summary of messages to the zope-tests list.
Period Sun Aug 21 11:01:01 2005 UTC to Mon Aug 22 11:01:01 2005 UTC.
There were 8 messages: 8 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:23:52 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002895.html

Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:25:22 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002896.html

Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:26:52 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002897.html

Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:28:22 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002898.html

Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:29:52 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002899.html

Subject: OK : Zope-2_8-branch Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:31:22 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002900.html

Subject: OK : Zope-trunk Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:32:52 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002901.html

Subject: OK : Zope-trunk Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Sun Aug 21 22:34:22 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-August/002902.html

___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


[Zope-dev] Python 2.4 with zope 2.7.6, on Windows

2005-08-22 Thread Aruna Kathiria


Hello Everyone:
Is it possible to use Python 2.4 with Zope 2.7.6 on windows plateform? 
I come to know how to use them on UNIX from /doc/INSTALL.txt but don't know 
how to install and use Python 2.4 and Zope 2.7.6 on windows platform.
By default Zope 2.7.6 is bundled with Python 2.3.5. For some reasons I want 
to use Python 2.4 with Zope 2.7.6 on Windows.
Thanks in advance.

With 
Regards, 
Aruna 
Kathiriya 
Sr.Consultant, 
CIGNEX Technologies, 
Inc 
T: 408.327.9900 x 
306 
F: 
408.273.6785 
E: [EMAIL PROTECTED] 
U: www.cignex.com
"Implement IT Right"
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Python 2.4 with zope 2.7.6, on Windows

2005-08-22 Thread Jens Vagelpohl


On 22 Aug 2005, at 07:53, Aruna Kathiria wrote:


Hello Everyone:

Is it possible to use Python 2.4 with Zope 2.7.6 on windows plateform?

I come to know how to use them on UNIX from /doc/INSTALL.txt but  
don't know how to install and use Python 2.4 and Zope 2.7.6 on  
windows platform.


By default Zope 2.7.6 is bundled with Python 2.3.5. For some  
reasons I want to use Python 2.4 with Zope 2.7.6 on Windows.


This is a FAQ: No, it is not recommended. Stick with the version of  
Python that is specified in the docs.


jens

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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] Python 2.4 with zope 2.7.6, on Windows

2005-08-22 Thread Dieter Maurer
Aruna Kathiria wrote at 2005-8-21 23:53 -0700:
Is it possible to use Python 2.4 with Zope 2.7.6 on windows plateform? 

We use Python 2.4 with Zope 2.7.2.

However (!) I had to fix a few places (identified by failing test cases
from Zope quite extensive test suite).

Apparently, Zope 2.8.1 is better prepared for Python 2.4.


And others already told you: you use Python 2.4 with Zope at your
own risk!


-- 
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] Python 2.4 with zope 2.7.6, on Windows

2005-08-22 Thread Aruna Kathiria

Yeah, it's true that I have to use Python 2.4 with Zope 2.7.6 Also I
can't go for Zope 2.8.1.
I also tried to fix few places but still cannot. 

Dieter, do you remember what and where you had to fix?
Thanks..


With Regards,
Aruna Kathiriya
Sr.Consultant,
CIGNEX Technologies, Inc
T:408.327.9900 x 306
F:408.273.6785
E:[EMAIL PROTECTED]
U:www.cignex.com
Implement IT Right


-Original Message-
From: Dieter Maurer [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 22, 2005 9:56 AM
To: Aruna Kathiria
Cc: zope-dev@zope.org
Subject: Re: [Zope-dev] Python 2.4 with zope 2.7.6, on Windows

Aruna Kathiria wrote at 2005-8-21 23:53 -0700:
Is it possible to use Python 2.4 with Zope 2.7.6 on windows plateform? 

We use Python 2.4 with Zope 2.7.2.

However (!) I had to fix a few places (identified by failing test cases
from Zope quite extensive test suite).

Apparently, Zope 2.8.1 is better prepared for Python 2.4.


And others already told you: you use Python 2.4 with Zope at your own
risk!


--
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] coverage.py, profile and hotshot support in Zope's testrunner

2005-08-22 Thread Jim Fulton

Stefane Fermigier wrote:



Sidnei da Silva wrote:


On Sun, Aug 21, 2005 at 10:20:28AM +0200, Stefane Fermigier wrote:
| I have added support for coverage analysis using coverage.py from 
Gareth | Rees and Ned Batchelder, as well as support for profiling 
using either the | profile or hotshot modules from the Python standard 
library, to Zope 2's | test runner test.py.

| | Justification:
| | - coverage.py will let you interactively focus on the modules you 
want to | check for coverage.

| | - profile is slow to collect data but quick for analysis.
| | - hotshot is fast when collecting but very slow for analysis. On 
the other | hand, one can feed the great KCacheGrind tool with hotshot 
data after some | transformation and this is the best way I have found 
so far for | interactively exploring profile data.


Eerm, the test runner in Zope 2 is the same from Zope 3. The version
in Zope 3 X3.0 has profile support using hotshot and coverage support
using the trace.py module, but the version in Zope 2 is earlier than
that.

How does that differ from what you're proposing?



1. I haven't found hotshot support in either Zope 2.8.1 nor the TRUNK.

2. Has I wrote, coverage.py can be used interactively (at least, from 
the command line) to focus on whichever package you are working on at 
the moment. You can also collect data from several runs, which is useful 
for us because we have to test each CPS package in a different run.


3. I understand that trace.py and coverage.py have some overlap, and 
should probably be merged into one great and up to date coverage tool. 
But before it is done, I find useful to have both tools at our disposal.


4. Same for hotshot and profile. Both are useful.


I don't think Sidnei was questioning the value of these, but
just pointing out that another version of the test runner already had
some of this.

I'll note that I'm working on a newer test runner that I hope to use
in Zope 2.9 and 3.2.  The new test runner is a nearly complete rewrite to
provide:

- A more flexible test runner that can be used for a variety of projects.
  The current test runner has been forked for ZODB, Zope 3, and Zope 2.
  That's why the Zope 3 version has features that are lacking in the Zope 2
  version.

- Support for layers of tests, so that it can handle unit tests and
  functional tests.

- A slightly better UI.

- Tests (of the test runner itself :)

See:

http://svn.zope.org/zope.testing/trunk/src/zope/testing/testrunner.txt?view=log
http://svn.zope.org/zope.testing/trunk/src/zope/testing/testrunner.py?view=log

I'd like to include coverage and profiling support. (There is partial support
now, but untested.)  Wanna help?

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
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: ZServer response RFC compliance improvement

2005-08-22 Thread Michael Dunstan
On 8/22/05, Tres Seaver [EMAIL PROTECTED] wrote:
 Are we sure that we won't be breaking the rather large possible set of
 installed servers running behind Apache 1.3.x with the bug for which
 adding the content length was a workaround?

I understand that this bug was resolved in Apache 1.3.27 [1]. Which is
a few years old now. And outdated by several security releases since
then.

Also OFS.Image been patched as of Zope 2.7.1 [2] in such a way that it
would have already tripped a combination of old-ish Apache and new-ish
Zope. Though ZServer was still throwing in a Content-Length: 0.
(Which I read as sufficient to provoke the bug in Apache  1.3.27.)

[1] http://www.apacheweek.com/issues/02-10-04

[2] 
http://cvs.zope.org/Zope/lib/python/OFS/Attic/Image.py?hideattic=0only_with_tag=Zope-2_7-branch#rev1.145.2.7
___
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] Re: OOP and Zope.

2005-08-22 Thread Josef Meile

Dieter Maurer wrote:

Fernando Lujan wrote at 2005-8-19 12:16 -0600:


I try to find information about programming in Zope with the OO
paradigm. I didn't find many documentation...

For instance, how can I define classes and instances once I just work
with dtml-methods and dtml-documents?



You can look at ZClasses.

Note, that there are people that recommend not to use
ZClasses because they want to drop ZClass support in some
future Zope release.

Yes, some people wants to drop them, but that is just a part of the
problem. Their bugs aren't a priority know, so, if I were the OP, I
wouldn't use them for a new development. I would use python based
products, which are also OO.

Regards,
Josef

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

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


[Zope] SQLConnectionIds

2005-08-22 Thread Nicholas Wieland
Again, this problem is making me mad :)
This is a simple TTW PageTemplate I'm using:

html
 body
 ul tal:repeat="dba here/SQLConnectionIDs" li tal:content="dba" placeholder /li /ul
 body
/html

This works without any problem, returning a list of tuples.
The same template in a FS based product raises a site error:

Unauthorized: You are not allowed to access 'SQLConnectionIDs' in this context (Also, an error occurred while attempting to render the standard error message.) 

that's not even logged.

A very similar DTML file on the FS, that cycles through SQLConnectionIds, works perfectly.

This is Zope 2.7 on Windows.

Is this a Zope bug ? 

TIA,
 ngw
		Yahoo! Messenger: chiamate gratuite in tutto il mondo ___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: OOP and Zope.

2005-08-22 Thread Fernando Lujan
On 8/22/05, Josef Meile [EMAIL PROTECTED] wrote:
 Yes, some people wants to drop them, but that is just a part of the
 problem. Their bugs aren't a priority know, so, if I were the OP, I
 wouldn't use them for a new development. I would use python based
 products, which are also OO.

I have a good knowledge of using python, there's some tutorial about
using it inside Zope with  a OO design?

Thanks.

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


Re: [Zope] Re: OOP and Zope.

2005-08-22 Thread Lennart Regebro
On 8/22/05, Fernando Lujan [EMAIL PROTECTED] wrote:
 I have a good knowledge of using python, there's some tutorial about
 using it inside Zope with  a OO design?

For Zope2, the previously mentioned Zope Developers Guide:
http://www.zope.org/Documentation/Books/ZDG/current

ZopeWiki put a lot of reference at your fingertips:
http://zopewiki.org/ZopeDevelopment

For Zope3, a good start is Web Component Development with Zope 3:
http://www.amazon.com/exec/obidos/tg/detail/-/3540223592/002-4460899-6725627?v=glance

and the Zope 3 Developer's Handbook is a handy reference:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326175/ref=pd_bxgy_text_1/002-4460899-6725627?v=glances=booksst=*
(Also available online, if you don't like paper:
http://www.zope.org/DevHome/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book).


Decide if you are gonna go with Zope2 or Zope3 first. They are quite
different. Ask again if you need help with the choice. :)
-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: OOP and Zope.

2005-08-22 Thread Dieter Maurer
Fernando Lujan wrote at 2005-8-22 06:01 -0600:
 
I have a good knowledge of using python, there's some tutorial about
using it inside Zope with  a OO design?

The Zope Developper Guide?

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


Re: [Zope] SQLConnectionIds

2005-08-22 Thread Dieter Maurer
Nicholas Wieland wrote at 2005-8-22 11:47 +0200:
Again, this problem is making me mad :)
This is a simple TTW PageTemplate I'm using:
 
html
  body
  ul tal:repeat=dba here/SQLConnectionIDs
li tal:content=dba placeholder /li
  /ul
  body
/html
 
This works without any problem, returning a list of tuples.
The same template in a FS based product raises a site error:
 
Unauthorized: You are not allowed to access 'SQLConnectionIDs' in this context 
(Also, an error occurred while attempting to render the standard error 
message.) 

SQLConnectionIDs does not have an explicit security declaration.
Therefore, it is protected by the folder's object permission.
Looks like the visitor does not have this permission.

VerboseSecurity may help you to analyse such problemes easier...
-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Help me with acquisition and custom types

2005-08-22 Thread Dieter Maurer
Mark Gibson wrote at 2005-8-21 12:38 -0600:
I've created two objects, A folderish object called myfolder, and a
document-type object called mydocument.  Here's how my classes are
defined...

class mydocument(
   CatalogAware,
   Implicit,
   Persistent,
   RoleManager,
   PropertyManager,
   Item):
class myfolder(
   CatalogAware,
   Implicit,
   Persistent,
   RoleManager,
   PropertyManager,
   Folder)

So, say I have a hierarchy like this...

/
/ObjectA
/folder
/folder/mydocument ( an instance of mydocument)
/folder/myfolder (an instance of myfolder)
/folder/myfolder/ObjectA

Ok.. I want to be able to call

http://mysite/folder/mydocument/ObjectA 
  - this works fine
http://mysite/folder/myfolder/ObjectA
 - this works fine
http://mysite/folder/myfolder/mydocument/ObjectA
 - this returns the ObjectA at '/ObjectA', I'd like it to return ObjectA
at '/folder/myfolder/ObjectA'

Any ideas how I would go about making this happen?

It will not work as acquisition works differently...

You should read Jim's acquisition lecture Containment before Context.
It tells you why acquisition will not do what you like.

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


Re: [Zope] Workflow question

2005-08-22 Thread Dieter Maurer
David Pratt wrote at 2005-8-21 23:43 -0300:
 ...
   # Catch put in traversal
   def __bobo_traverse__(self, REQUEST):
   method=REQUEST.get('REQUEST_METHOD', 'GET')
   if method == 'PUT':
   PUT(REQUEST, RESPONSE)

Usually, __bobo_traverse__ gets an additional argument.
I expect that you will get a TypeError: wrong number of arguments.


After you fixed this, the code might work in your special case --
but it is not using the correct idiom:

  Usually, you want to handle the request method only
  at the end of the traversal and not at each intermediate
  place. For this, you can look at
  REQUEST['TraversalRequestNameStack']. It contains the
  traversal steps still to be performed.


   # Using default put method from NullResource
   def _default_PUT_factory( self, name, typ, body ):
 ...
   def PUT(self, REQUEST, RESPONSE):
 ...

Why do you override these methods as apparently, you do not use
them...

You do use a PUT function (!) but you do not define it.
Definitely, this will fail...


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


Re: [Zope] Workflow question

2005-08-22 Thread David Pratt

Hi Dieter.

On Monday, August 22, 2005, at 01:45 PM, Dieter Maurer wrote:


David Pratt wrote at 2005-8-21 23:43 -0300:

...
# Catch put in traversal
def __bobo_traverse__(self, REQUEST):
method=REQUEST.get('REQUEST_METHOD', 'GET')
if method == 'PUT':
PUT(REQUEST, RESPONSE)


Usually, __bobo_traverse__ gets an additional argument.
I expect that you will get a TypeError: wrong number of arguments.



Ok thanks, I'll look at what else it requires


After you fixed this, the code might work in your special case --
but it is not using the correct idiom:

  Usually, you want to handle the request method only
  at the end of the traversal and not at each intermediate
  place. For this, you can look at
  REQUEST['TraversalRequestNameStack']. It contains the
  traversal steps still to be performed.


Thanks.  I'll look at this as well.





# Using default put method from NullResource
def _default_PUT_factory( self, name, typ, body ):
...
def PUT(self, REQUEST, RESPONSE):
...


Why do you override these methods as apparently, you do not use
them...


I guess my thought it that I want everything to happen normally with 
the PUT except no object creation (which seemed to occur where I had 
commented it out) of the PUT method.  My workflow script and method 
from a tool still needs the content type and body for processing so 
overriding the original methods seemed a reasonable way to go.


I'm hoping to get something together enough to test today or tomorrow.

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

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


[Zope] max 2 levels of indirection?

2005-08-22 Thread Sean Dunn








Im running Zope 2.0.7, and Im having a
problem.. Consider me a newbie, as Ive only been using Zope for a few
weeks.



After boiling the problem down to a test case, it seemed
that I couldnt have a DTML method call a DTML method which then calls a
Python script. But then I realized it was a more general problem of max number
levels of indirection.. So I cant have a DTML-DTML-DTML or
DTML-DTML-PythonScript. Is this a bug? When I try this, I get a Name
Error, which says that the name of the 3rd level object is not
defined.





Heres an example:



DTML Method TestA:

dtml-var expr=TestB()



DTML Method TestB:

dtml-var expr=TestC()



DTML Method TestC:

Test C has run.





If I view TestA, I get the NameError that TestC doesnt
exist. If I view TestB, I get the output Test C has run. All objects
are in the same folder.



Is there some namespace weirdness that I dont
understand?



Thanks,

Sean








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


Re: [Zope] max 2 levels of indirection?

2005-08-22 Thread J Cameron Cooper

Sean Dunn wrote:
I’m running Zope 2.0.7, and I’m having a problem.. Consider me a newbie, 
as I’ve only been using Zope for a few weeks.


After boiling the problem down to a test case, it seemed that I couldn’t 
have a DTML method call a DTML method which then calls a Python script. 
But then I realized it was a more general problem of max number levels 
of indirection.. So I can’t have a DTML-DTML-DTML or 
DTML-DTML-PythonScript. Is this a bug? When I try this, I get a Name 
Error, which says that the name of the 3^rd level object is not defined.


Here’s an example:

DTML Method TestA:

dtml-var expr=”TestB()”

DTML Method TestB:

dtml-var expr=”TestC()”

DTML Method TestC:

Test C has run.

If I view TestA, I get the NameError that TestC doesn’t exist. If I view 
TestB, I get the output “Test C has run”. All objects are in the same 
folder.


Is there some namespace weirdness that I don’t understand?


When you call DTML methods directly, they expect to be passed certain 
parameters, including the namespace. When you simply use the names, this 
is done implicitly. When calling explicitly, you can lose the namespace 
if you don't follow the proper convention. I think you'll find that it 
works if you try::


 DTML Method TestA:

 dtml-var TestB

 DTML Method TestB:

 dtml-var TestC

 DTML Method TestC:

 Test C has run.

For calling DTML explicitly, it usually looks like::

 dtml-var expr=”TestC(None, _)”

See http://www.plope.com/Books/2_7Edition/AppendixE.stx for why.

Also:
http://mail.zope.org/pipermail/zope-db/2003-March/001554.html

This is one of the good reasons to avoid DTML, by the way.

--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

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


[Zope] ZASync method calls

2005-08-22 Thread Jan-Ole Esleben
Hi!

I'm having a really complicated problem that I don't know how to put into
words properly, because I'm really vague on what's causing it and the
setup is highly involved; I would be _really_ glad if someone could help me
out with this:

I have a ZOPE instance (connected to a ZEO server) running a custom
method call wrapper that decides (based on the method's arguments) to
run a method asynchronously using zasync (as well as some other stuff that
I think isn't important in the context of my problem). All this has
been tested. For various
reasons, the method call's path is approximately as follows:

0. Method call using a generic Python method
1. Python code - resolves the method's location and name using ZOPE methods
2. Method dispatcher (called via ZOPE): dispatches synchronously or
 asynchronously, using zasync, zope_exec and putSessionCall; the method
 called is again a ZOPE method that calls the final method as another
 ZOPE method

The apparent massive indirection cannot be avoided (for rather complicated
reasons). Everything is supposed to be highly generic.

My problem is this: if I use a test method that dispatches such an asynchronous
method that is supposed to change an instance variable (the class is 
persistent) and run for ten seconds, then wait for fourteen seconds and see
if the method has run (check the instance variable) synchronously (while the
asynchronous method is supposed to work in the background), I find the
variable unchanged; further checks (using print statements) confirm that the
asynchronous method indeed doesn't run until my assertion fails, even if I give
it a lot of time.

If I disconnect both - run the long running method asynchronously, then run
(via ZOPE directly, not from within the same method call) a synchronous method
that waits for fourteen seconds and checks the variable, the asynchronous call
works just fine (even though both run alongsinde for a time).

It isn't the number of threads available to the zserver, I've increased that 
and nothing has changed. Manual tests of asynchronous methods also don't show
anything wrong with my zasync setup. I can only assume that the asynchronous
method is _started_ only _after_ the caller has finished. Is there a reason for
that, and can I circumvent it? Or am I completely wrong and something else
isn't working?

I'm on Windows XP SP2, ZOPE 2.7.6, Python 2.3.5 with Twisted installed.

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