[Zope] Editing downloaded + installed product?

Thomas B. Passin tpassin@mitretek.org
Thu, 21 Oct 1999 15:16:01 -0400


From: Stefan Hoffmeister <Stefan.Hoffmeister@Econos.de>

>: On Thu, 21 Oct 1999 12:48:49 -0400, Michel Pelletier wrote:
>
>>> From: Stefan Hoffmeister [mailto:Stefan.Hoffmeister@Econos.de]
>
>>> (Re)starting ZServer takes about 18 seconds on my development
>>> NT4 system
>>> (192 MB, 540 Mhz overclocked Celeron). I somehow feel that
>>> this is an a
>>> tad bit inappropriate time lag.
>>
>
>Let me add "for development purposes" to clarify.
>
>Look, I am used to blazingly fast compilers - Object Pascal (Borland
>Delphi) and Borland C++Builder with well-done pre-compiled headers.
>
>19 seconds delay, combined with the "manual" action of shutting down the
>server + starting it up again - I perceive that as an eternity.
>
>What do I do in these 19 seconds?
>
>>the ability to do
>>a python reload could be elaborated and implimented, of course you have
>>to source code so you can provide a patch. ;)
>


I'm having the same problem using Python code as an external method.  The
trouble is that when you change the code and rrun it, the Python interpreter has
continued to run all the while (since it is running ZServer).  It thinks that
all your code has already been bound to the existing method and class names you
defined the first time you ran the code, and it doesn't realize there have been
changes.

A Python reload() call, as mentioned above, can work if you have imported a
module using "import spam".  You could put an import spam/reload(spam) pair into
the function call.  But reload() doesn't work for all flavors of the import
statement.  In my case, some of my code can be changed on the fly, and for other
parts I have to restart the server.  Perhaps some Python expert can give us
working examples (not guesses!) showing how to construct modules and import
trees so they will always update without us having to restart the server.

On the other hand, those reload() calls would take time to execute, so it should
be possible to remove them for the production system easily and without ill
effects.

Thomas Passin