mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Added -d option to pass directory to the Python sqeezer
This commit is contained in:
parent
71f33c97d8
commit
9da45b6d81
@ -58,13 +58,6 @@ pyDir=$DIRECT/lib/py
|
|||||||
extDir=$DIRECT/src/extensions
|
extDir=$DIRECT/src/extensions
|
||||||
pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
|
pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
|
||||||
|
|
||||||
if [ `uname | grep CYGWIN` ]; then
|
|
||||||
install_dir="$(cygpath -aw $install_dir)"
|
|
||||||
pyDir="$(cygpath -w $pyDir)"
|
|
||||||
extDir="$(cygpath -w $extDir)"
|
|
||||||
pSqueezer="$(cygpath -w $pSqueezer)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$buildType" = "linux" ]; then
|
if [ "$buildType" = "linux" ]; then
|
||||||
cd $DIRECT/bin
|
cd $DIRECT/bin
|
||||||
ppython -d generatePythonCode -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
ppython -d generatePythonCode -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
||||||
@ -72,14 +65,22 @@ if [ "$buildType" = "linux" ]; then
|
|||||||
|
|
||||||
elif [ "$buildType" = "win-debug" ]; then
|
elif [ "$buildType" = "win-debug" ]; then
|
||||||
cd $DIRECT/bin
|
cd $DIRECT/bin
|
||||||
|
pyDir="$(cygpath -w $pyDir)"
|
||||||
|
extDir="$(cygpath -w $extDir)"
|
||||||
|
pSqueezer="$(cygpath -w $pSqueezer)"
|
||||||
ppython -d generatePythonCode -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
ppython -d generatePythonCode -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
||||||
elif [ "$buildType" = "win-release" ]; then
|
elif [ "$buildType" = "win-release" ]; then
|
||||||
cd $DIRECT/bin
|
cd $DIRECT/bin
|
||||||
|
pyDir="$(cygpath -w $pyDir)"
|
||||||
|
extDir="$(cygpath -w $extDir)"
|
||||||
|
pSqueezer="$(cygpath -w $pSqueezer)"
|
||||||
ppython generatePythonCode -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
ppython generatePythonCode -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
||||||
|
|
||||||
elif [ "$buildType" = "win-publish" ]; then
|
elif [ "$buildType" = "win-publish" ]; then
|
||||||
# no assertions, no comments, no docstrings
|
# no assertions, no comments, no docstrings
|
||||||
cd $DIRECT/bin
|
cd $DIRECT/bin
|
||||||
|
pyDir="$(cygpath -w $pyDir)"
|
||||||
|
extDir="$(cygpath -w $extDir)"
|
||||||
|
pSqueezer="$(cygpath -w $pSqueezer)"
|
||||||
ppython -OO generatePythonCode -O -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
ppython -OO generatePythonCode -O -v -d $pyDir -e $extDir -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
||||||
optimizeFlag="-O"
|
optimizeFlag="-O"
|
||||||
ppythonOptimizeFlag="-OO"
|
ppythonOptimizeFlag="-OO"
|
||||||
@ -88,12 +89,13 @@ elif [ "$buildType" = "install" ]; then
|
|||||||
# Use relative paths; as installed on a machine without ctattach etc.
|
# Use relative paths; as installed on a machine without ctattach etc.
|
||||||
pyDir=$install_dir/lib/py
|
pyDir=$install_dir/lib/py
|
||||||
ppython=$install_dir/bin/ppython
|
ppython=$install_dir/bin/ppython
|
||||||
|
pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
|
||||||
$ppython -d $install_dir/bin/generatePythonCode -O -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
$ppython -d $install_dir/bin/generatePythonCode -O -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
||||||
|
|
||||||
elif [ "$buildType" = "release" ]; then
|
elif [ "$buildType" = "release" ]; then
|
||||||
# Use relative paths; as installed on a machine without ctattach etc.
|
# Use relative paths; as installed on a machine without ctattach etc.
|
||||||
pyDir=$install_dir/lib/py
|
pyDir=$install_dir/lib/py
|
||||||
ppython=$install_dir/bin/ppython
|
ppython=$install_dir/bin/ppython
|
||||||
|
pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
|
||||||
$ppython $install_dir/bin/generatePythonCode -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
$ppython $install_dir/bin/generatePythonCode -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
|
||||||
else
|
else
|
||||||
echo "Invalid parameter: $buildType"
|
echo "Invalid parameter: $buildType"
|
||||||
@ -102,9 +104,8 @@ fi
|
|||||||
|
|
||||||
if [ "$fSqueeze" = "squeezeMe" ]; then
|
if [ "$fSqueeze" = "squeezeMe" ]; then
|
||||||
echo SQUEEZING PandaModules
|
echo SQUEEZING PandaModules
|
||||||
cd $pyDir || exit
|
rm -f $pyDir/PandaModules.py* || exit
|
||||||
rm -f PandaModules.py* || exit
|
$ppython $ppythonOptimizeFlag $pSqueezer $optimizeFlag -d $pyDir || exit
|
||||||
$ppython $ppythonOptimizeFlag $pSqueezer $optimizeFlag || exit
|
|
||||||
else
|
else
|
||||||
# renaming PandaModulesUnsqueezed.py to PandaModules.py
|
# renaming PandaModulesUnsqueezed.py to PandaModules.py
|
||||||
cd $pyDir || exit
|
cd $pyDir || exit
|
||||||
|
@ -3,14 +3,15 @@ import sys
|
|||||||
import getopt
|
import getopt
|
||||||
import pandaSqueezeTool
|
import pandaSqueezeTool
|
||||||
|
|
||||||
# Assumption: We will be squeezing the files from the current directory.
|
# Assumption: We will be squeezing the files from the current directory or the -d directory.
|
||||||
|
|
||||||
try:
|
try:
|
||||||
opts, pargs = getopt.getopt(sys.argv[1:], 'O')
|
opts, pargs = getopt.getopt(sys.argv[1:], 'Od:')
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
# User passed in a bad option, print the error and the help, then exit
|
# User passed in a bad option, print the error and the help, then exit
|
||||||
print e
|
print e
|
||||||
print 'Usage: pass in -O for optimized'
|
print 'Usage: pass in -O for optimized'
|
||||||
|
print ' pass in -d directory'
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
fOptimized = 0
|
fOptimized = 0
|
||||||
@ -20,6 +21,8 @@ for opt in opts:
|
|||||||
if (flag == '-O'):
|
if (flag == '-O'):
|
||||||
fOptimized = 1
|
fOptimized = 1
|
||||||
print 'Squeezing pyo files'
|
print 'Squeezing pyo files'
|
||||||
|
elif (flag == '-d'):
|
||||||
|
os.chdir(value)
|
||||||
|
|
||||||
def getSqueezeableFiles():
|
def getSqueezeableFiles():
|
||||||
fileList = os.listdir(".")
|
fileList = os.listdir(".")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user