[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 )




Re: [Zope] Some examples of DTML scripts ?

2000-05-19 Thread Cornelis J. de Brabander

go to
http://www.zope.org
and click on the 'dtml source' link at the bottom of every page
cb
-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [EMAIL PROTECTED]
Aan: [EMAIL PROTECTED] [EMAIL PROTECTED]
Datum: vrijdag 19 mei 2000 11:55
Onderwerp: [Zope] Some examples of DTML scripts ?


Hi,


I'm a french new Zope developper and I'm a little bite lost with the
english
documentation... I think that some examples will help me a lot. So, if
someone
have some and can spend two minutes to send them tome, I will be very
happy.


Thanks
Fred

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




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




[Zope] Zope log rotation

2000-05-19 Thread Dan L. Pierson

Chien-pin Wang writes:
  Dear All:
  
  Quick question about Zope admin.
  Can zope automatically rotate its access log? Thanks.

I use logrotate on Linux for this.  Unfortunately I have to use the
before and after config options to stop zserver before and restart it
after -- otherwise zserver just keeps appending to the old log.

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




Re: [Zope] gotcha for zope on solaris2.7 - make sure you use pthreads.

2000-05-19 Thread Anthony Baxter


Let's see:

network lookups would fail, sometimes, strangely,

signals would be delivered to _all_ children (not just the one
that had installed a signal handler) -- so if you had an external
method that popen'd another program, when the SIGCHLD came in, it
would kill the mainloop. 

The signals were the really shocking problem.

Anthony.
 Tony McDonald wrote
 At 5:48 pm +1000 19/5/00, Anthony Baxter wrote:
 If you're running a Zope on Solaris2.7 and you're seeing strange
 behaviour, make sure that your python executable's been built and
 linked with pthreads, not solaris threads. I've just had a horrible
 time figuring out why I was seeing very strange behaviour on Solaris
 until I noticed this.
 
 ldd `which python` should show /usr/lib/libpthread.so, NOT
 /usr/lib/libthread.so.
 
 Can you tell us what kind of behaviour Anthony?
 
 I'm using 2.6 on our main box (and 2.7 on another dev. box).
 
 cheers,
 tone
 --
 Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
 http://nle.ncl.ac.uk/
 The Medical School, Newcastle University Tel: +44 191 222 5888
 Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 

-- 
Anthony Baxter [EMAIL PROTECTED]   
It's never too late to have a happy childhood.


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




Re: [Zope] help with rpms on RedHat6.2

2000-05-19 Thread Chris McDonough

Peter,

A step-by-step guide to installing Zope is available at
http://www.zope.org/Members/mcdonc/HowTos/zopeinstall/ZOPE-INSTALL-HOWTO

Peter Halliday wrote:
 
 I am developer who really loves python, and want to start using it to
 develop my web applications.  I run Apache 1.3 on a Red Hat 6.2 system
 with python 1.5.2.  I have had trouble knowing what to do next in my
 quest to run Zope.  I installed the main Zope rpm and the pcgi rpm.
 What needs to be done next.  I have tried installing zope a number of
 different times and in a number of different ways (rpm, tar.gz).  Each
 without success.  I want to run pcgi, so I can keep using apache.  Can
 you help me please.
 
 !--
 Peter Halliday
 Online Application Developer
 Whatstone Logic, Inc.
 http://www.whetstonelogic.com
 --
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

-- 
Chris McDonough
Digital Creations
Publishers of Zope - http://www.zope.org

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




Re: [Zope] SiteAccess smashes 'REQUEST.resolve_url(...)' in DTML ?

2000-05-19 Thread Martin Grönemeyer

 i have some strange problmes by using the
 "REQUEST.resolve_url('http://mydomain/...')" in DTML if SiteAccess is
 active. I have also some Sites in use without SiteAccess and no problems
 with the above method.

Tell me more about the problem, please.  SiteAccess replaces
REQUEST.traverse, which is called by REQUEST.resolve_url.  Are you just
using resolve_url to grab objects given their path?


Getting an object-Context (index_html = DTML Document) by absolute URL:

dtml-with "REQUEST.resolve_url('http://mydomain/home/index_html')"
dtml-var title
/dtml-with

throws

Error Type: ValueError
Error Value: Different namespace.


If i try to get an object-context of an unexisting object, the snippet
above throws the correct message that the ressource wasn't found.

On a zope-installation (2.2alpha und 2.1.2) without SiteAccess this example
works fine.




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




Re: [Zope] Representing rows from a ZSQL method

2000-05-19 Thread J. Atwood

Good and bad news.. There is no real "product" to do this.. but it is not at
all hard to do with Zope tools..

 For example:
 -Displaying an order on the web with the order header (consisting of the
 client name, address, ZIP, etc.) and the order lines with the products to
 purchase.

This is a combination of a ZSQL Method (to database of you choice) and
displayed using a DTML-IN tags. No biggy.


 -Displaying a list of invoices between two dates with several columns
 (Invoice date, amount, VAT, invoice number, etc.).

Same thing. Create another ZSQL Method that calls the list and display it
using DTML-IN to iterate over the list. Display the data you want with the
DTML or limit it in the SQL statement.

 -Displaying a price list of our products with several columns (reference,
 description, price, weight, etc.) and grouping the products by different
 criteria. For example inserting a row with the brandname of the next group
 of products or inserting a row of the product type.

Same deal.. same ease..

Take a look at http://fundraising.gotschool.com which is 100% pure Zope with
a PostgreSQL backend that serves up almost everything (90% of what you see).
I have about 25 ZSQL Methods doing the work for the entire site with lots of
database interactivity (reading, writing, updating).

Start with the ZSQL Guide some How-Tos, the ZDP and when you get stuck send
a message to the group here.

Enjoy,
J


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




[Zope] Zope SQL Database Connection

2000-05-19 Thread joel grimes

Beginner Question

I'm trying to add a database connection to a site (my first one).  I tried 
adding a SQL Method and am told I need to add a Zope Database Connection.  I 
can't find that in the list of available objects.  Can someone direct me to 
a resource that explains how?  It's not mentioned in the quick start guide.  
I'll be using an Access or SQL Server Database.

Oh yeah...and what the heck is a Z Gadfly Database Connection?

Thanks,

Joel Grimes
[EMAIL PROTECTED]


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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




Re: [Zope] Fw:

2000-05-19 Thread R. David Murray

On Fri, 19 May 2000, Tom Scheidt wrote:
  Do you know if I can limit the id to the last
  3 letters, rather than the first?  My images have
  _xl, _l etc. on the end.
[...]
  ul
  dtml-in "tester.fileValues()"
dtml-if "type=='image/jpeg'"
  dtml-if "id[0:3]=='tn_'"
img src="dtml-var "parent.id"/dtml-var url"

dtml-if "id[-3:]=='_xl'"

If you take a look at the python language guide, and keep in mind
that the 'string' module is available through the '_' namespace
variable (eg: "_.string.split(somevar)"), you can do even fancier
things like find the character position of the '_' in the string
and copy out just the characters after it.

In general, you want to take a look at the Python documentation
(www.python.org) to learn how to compose complex 'if' statments.

--RDM


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




Re: [Zope] SiteAccess smashes 'REQUEST.resolve_url(...)' in DTML ?

2000-05-19 Thread Evan Simpson

- Original Message -
From: Martin Grönemeyer [EMAIL PROTECTED]
 dtml-with "REQUEST.resolve_url('http://mydomain/home/index_html')"
 dtml-var title
 /dtml-with

 throws

 Error Type: ValueError
 Error Value: Different namespace.

REQUEST.resolve_url requires that the URL you pass to it begins with
REQUEST.script, otherwise it will throw this Exception.  It treats the URL
very much like one coming from a browser, so all SiteRoots and Access Rules
affect the result.

Cheers,

Evan @ digicool  4-am


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




Re: [Zope] Local File System

2000-05-19 Thread Jonothan Farr

 I'm just getting started, but managed to use
 the following to display only JPG's, and then
 only ones starting with "tn_" (my thumbnails):


There's an easier way. =)

ul
dtml-in "tester.fileIds(spec='tn_*.jpg')"
  img src="tester/dtml-var sequence-item"
/dtml-in
/ul

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998



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