37 lines
975 B
Bash
Executable File
37 lines
975 B
Bash
Executable File
#! /bin/sh
|
|
|
|
# Linux case
|
|
if [ -z "$PANDA_ROOT" ]; then
|
|
# Convert semicolons back to colons
|
|
PYTHONPATH=`echo $PYTHONPATH | sed 'y/;/:/'`
|
|
export PYTHONPATH
|
|
# Run unbuffered output, with any options passed in
|
|
exec python -u $*
|
|
exit 1
|
|
fi
|
|
|
|
# Under Windows/Cygwin, we have to do this whole thing a little differently.
|
|
# We have to de-cygwinify the semicolon separated PYTHONPATH
|
|
# The new path
|
|
NEWPYTHONPATH=
|
|
# Temporarily change the semicolons into spaces
|
|
for path in `echo $PYTHONPATH | sed 'y/;/ /'`; do
|
|
# For each entry run it through the cygwin filter
|
|
NEWPYTHONPATH=$NEWPYTHONPATH\;`cygpath -w $path`
|
|
done
|
|
# Set the new PYTHONPATH
|
|
PYTHONPATH=$NEWPYTHONPATH
|
|
export PYTHONPATH
|
|
|
|
# We can't run with -u under windows for some reason. But we do need to
|
|
# make a distinction between python_d and python. We'll accept the user
|
|
# parameter -d to indicate we should run python_d.
|
|
|
|
if [ x"$1" = x"-d" ]; then
|
|
shift 1
|
|
exec python_d $*
|
|
else
|
|
exec python $*
|
|
fi
|
|
|