[Zope-dev] Slow startup times

2000-05-19 Thread Toby Dickenson

A number of times the subject of slow startup times has been raised,
because it's particularly annoying while developing python products.
I've always found it very snappy (restart in less than 4 seconds), but
yesterday I found a machine where it was much slower (20 seconds).

With the patch below, all my machines can now restart Zope in under 3
seconds ;-)

http://classic.zope.org:8080/Collector/1260/view

Toby Dickenson
[EMAIL PROTECTED]

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




[Zope-dev] long-running external python method

2000-05-19 Thread Mika, David P (CRD)

I have woes calling a long-running external class method.  The external method must be 
called after
the 
class instance is constructed, because the method modifies class properties.  
Modifications are 
done in the external method using python's urllib pointing to the object's manage_edit 
DTML method.  
This is done to keep the class updated with progress of this long running process.  
The process, by 
the way, is started in a daemon thread so my class_add DTML method can return and 
(re)display
progress.

I know I'm getting tangled up in DTML namespaces.  For instance, I know I can do the 
following 
inside my class_add DTML method:

dtml-with "ZDeform2DClass.createInObjectManager(REQUEST['id'], REQUEST)"
  dtml-call "propertysheets.SimulationStatus.manage_editProperties(REQUEST)"
  dtml-call "ZDeformStart()"
/dtml-with

where ZDeformStart is the external method.  But I can't do this because it's a gamble 
to assume the
class 
instance is created before the external method tries to call the instance's 
manage_edit!  I don't
think the class
is committed until the final /dtml-with.  I have tried synching the daemon thread in 
the external
method,
but this conflicts with Zope pickling...

I would like to do something like: 

dtml-with "ZDeform2DClass.createInObjectManager(REQUEST['id'], REQUEST)"
  dtml-call "propertysheets.SimulationStatus.manage_editProperties(REQUEST)"
/dtml-with

dtml-call "ZDeform2DClass.ZDeformStart()"

This ensures the class is committed before ZDeformStart is called, but this returns an 
AttributeError
on 
ZDeformStart.  I don't know how to call this method outside the "with" constructor.  
Could someone 
offer a zope-line?  

David Mika
GE Corporate Research  Development
k1-mb 237
One Research Circle
Niskayuna, NY 12309

Ph: 518 387 4223
Fx: 518 387 6232


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




[Zope-dev] Subclassing LoginManager

2000-05-19 Thread Dan L. Pierson

OK, time for another Zen fix :-)

It looks like I've almost got PTK working with the latest
LoginManager.  The remaining problem is that the login form doesn't
work.  I've finally figured out why.
PTKBase.MemberFolder.MemberFolderBase.validate is much hairier than
LoginManager.LoginManager.validate.  A rough sketch is like this:

if req_has('__ac'):
... handle cookie login ...

if req_has('__ac_name') and req_has('__ac_password'):
... handle explicit login ...

if auth and lower(auth[:6]) != 'basic': 
... do basic authentication ...

... climb up the acquisition hierarchy ...

... try anonymous ...

I know that the official way to do most of this sort of thing with
LoginManager is by defining new LoginMethods, but I just don't see how 
to make LoginManager even try the LoginMethods at the correct time
without overriding validate.

Am I on the right track here?

Dan Pierson

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