[Zope-dev] PythonScript execution

2003-07-22 Thread Hubert Muller
Wycinite cytrusyHello,
We have built a Zope/CMF/Plone site.
The site contains a flash movie which is responsible for generating an
animated menu. The menu utilizes PythonScript which goes through Folder
objects, gets its names and produces XML with a drawers structure. I'm sure
that python script does everything well (no unneccesary loop runs, etc.)
when I am accessing it from the web browser - the script outputs xml very
quickly (0.05 sec).
When I access the site from the browser (internetExplorer), the first 10
elements of site transfer quickly. When the flash movie loads it requests
python script for XML. Then the browser (attention! BROWSER not flash
object) waits for about 4-5 seconds. When the XML reaches Flash, the browser
attempts to load the remaining elements of site. I repeat this with Opera
and the site loads significantly smoother, without significant troubles. I
notice that the flash movie this time loads at the end of the requests
queue. (Probably Opera applies longer intervals between requests). The site
includes 20 graphics objects (60KB total).
Is it possible that Zope has troubles handling 30 requests when the server
configuration is IntelXeon2.4GHz - 512MB?
Is there any performance issue with PythonScript execution during handling
many requests?
How can this issue be prevented?

Thanks in advance,
Hubert Muller



___
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] PythonScript execution

2003-07-22 Thread Dieter Maurer
Hubert Muller wrote at 2003-7-22 11:44 +0200:
  
  The site contains a flash movie which is responsible for generating an
  animated menu. The menu utilizes PythonScript which goes through Folder
  objects, gets its names and produces XML with a drawers structure. I'm sure
  that python script does everything well (no unneccesary loop runs, etc.)
  when I am accessing it from the web browser - the script outputs xml very
  quickly (0.05 sec).
  When I access the site from the browser (internetExplorer), the first 10
  elements of site transfer quickly. When the flash movie loads it requests
  python script for XML. Then the browser (attention! BROWSER not flash
  object) waits for about 4-5 seconds. When the XML reaches Flash, the browser
  attempts to load the remaining elements of site. I repeat this with Opera
  and the site loads significantly smoother, without significant troubles. I
  notice that the flash movie this time loads at the end of the requests
  queue. (Probably Opera applies longer intervals between requests). The site
  includes 20 graphics objects (60KB total).
  Is it possible that Zope has troubles handling 30 requests when the server
  configuration is IntelXeon2.4GHz - 512MB?

It should not have problems to serve 30 graphic objects with 60 kB total
size.

The fact that Opera works smoother indicates that it is more
a browser problem.

I would probably use a TCP logger (e.g. Shane's tcpwathc)
to understand the conversation between browser and Zope.


Dieter

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


[Zope-dev] PythonScript

2001-12-04 Thread Dirk Datzert

Hi,

I have following trivial problem:

A DTML-Mthode calls a PythonScript suchThemen with Argumen themen like
this

  dtml-in suchThemen(themen)
dtml-var themas
  /dtml-in

The PythonScript should return values and I want to display in the
dtml-in-loop the result variable themas.

Question: How must I programm the PythonScript that suchThemen returns
variables of name themas ?

Thanks

Dirk


___
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] PythonScript for iso_week

2001-03-14 Thread Steve Alexander

Hi folks,

At various times in the past, people on this list have asked about 
getting week numbers from DateTime instances.

I recently had this requirement, so I wrote a PythonScript to produce an 
iso_week tuple (year, week_number, dow_monday_is_one__sunday_is_seven) 
from a DateTime instance.

I've submitted the same to the collector as a feature-enhancement patch 
to DateTime.py.

I've tested this by empirically comparing it with the output of 
mxDateTime's iso_week attribute for all days from 1920-01-01 to some 
date in the twenty-third century.

Note also that this iso_week method does not create additional DateTime 
instances.

See also http://www.cl.cam.ac.uk/~mgk25/iso-time.html


PythonScript iso_week

Parameters: date

doy=date.dayOfYear()
dow=(date.dow()-1)%7
y=date.year()
thurs_this_week=doy+(3-dow)
is_leap=y%4==0 and (y%100!=0 or y%400==0)

if thurs_this_week(is_leap and 366 or 365):
   week=1
   if dow8:
 y=y+1
else:
   mon_this_week=doy-dow
   day_year_begins=(dow-doy+1)%7
   day_of_4_jan=(day_year_begins+3)%7
   monday_of_first_week=4-day_of_4_jan
   week=(mon_this_week-monday_of_first_week)/7+1

   if week==0:
 y=y-1
 is_last_leap=y%4==0 and (y%100!=0 or y%400==0)
 if day_year_begins==4 or (day_year_begins==5 and is_last_leap):
   week=53
 else:
   week=52

return y,week,dow+1



--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


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