Here is a suggestion for improvement of the Appserver script:

When debugging an application, I like to run the Appserver with unbuffered
Python output (Python option -u). Also, it might make sense to run it with
Python using optimization (Python option -O). However, you cannot give these
parameters to the Appserver script, since they would be passed on to the
ThreadedAppServer script, and not to Python. My suggestion is to catch these
two options if they are given in advance, and only pass the rest of the
parameters on to the ThreadedAppServer:

----------------- AppServer ------------------------------------

#!/bin/sh

# You may give the following Python parameters in advance
# followed by the parameters passed on to ThreadedAppServer
# -O with optimization (.pyo instead of .pyc)
# -u unbuffered output (useful for debugging)
unset OPTIONS
while getopts ":Ou" OPT; do
    case $OPT in O | u) OPTIONS="$OPTIONS -$OPT";; esac
done
shift `expr $OPTIND - 1`

RETCODE=3 # as long as the appserver returns a 3, it wants to be restarted
while test $RETCODE -eq 3; do
    /usr/bin/env python $OPTIONS Launch.py ThreadedAppServer $*
    RETCODE=$?
done

----------------------------------------------------------------

Also, I noticed a minor flaw in WebKit/ImportSpy.py. There, the line

if f[-4:] == '.pyc':

should be replace to

if f[-4:].lower() in ('.pyc', '.pyo'):

There is a similar line in MiscUtils/inspect.py which is already ok.

----------------------------------------------------------------

Christoph



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to