mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Updated to squeeze pandamodules not showbaseglobal
This commit is contained in:
parent
899781208a
commit
5c6aa9b77c
@ -1,20 +1,43 @@
|
||||
import os
|
||||
import sys
|
||||
import getopt
|
||||
import pandaSqueezeTool
|
||||
|
||||
# Assumption: We will be squeezing the files from C:\Panda\lib\py
|
||||
|
||||
try:
|
||||
opts, pargs = getopt.getopt(sys.argv[1:], 'O')
|
||||
except Exception, e:
|
||||
# User passed in a bad option, print the error and the help, then exit
|
||||
print e
|
||||
print 'Usage: pass in -O for optimized'
|
||||
sys.exit()
|
||||
|
||||
fOptimized = 0
|
||||
# Store the option values into our variables
|
||||
for opt in opts:
|
||||
flag, value = opt
|
||||
if (flag == '-O'):
|
||||
fOptimized = 1
|
||||
print 'Squeezing pyo files'
|
||||
|
||||
def getSqueezeableFiles():
|
||||
directDir = os.getenv('DIRECT')
|
||||
fileList = os.listdir(directDir + "\lib\py")
|
||||
newFileList = []
|
||||
for i in fileList:
|
||||
if i[-4:] == ".pyc":
|
||||
j = directDir + "/lib/py/" + i
|
||||
newFileList.append(j)
|
||||
return newFileList
|
||||
directDir = os.getenv('DIRECT')
|
||||
fileList = os.listdir(directDir + "\lib\py")
|
||||
newFileList = []
|
||||
if fOptimized:
|
||||
targetFileExtension = ".pyo"
|
||||
else:
|
||||
targetFileExtension = ".pyc"
|
||||
for i in fileList:
|
||||
base,ext = os.path.splitext(i)
|
||||
if (ext == ".py"):
|
||||
j = directDir + "/lib/py/" + i
|
||||
newFileList.append(j)
|
||||
return newFileList
|
||||
|
||||
def squeezePandaFiles():
|
||||
l = getSqueezeableFiles()
|
||||
pandaSqueezeTool.squeeze("panda", "ShowBaseGlobal", l)
|
||||
l = getSqueezeableFiles()
|
||||
pandaSqueezeTool.squeeze("PandaModules", "PandaModulesUnsqueezed", l)
|
||||
|
||||
squeezePandaFiles()
|
||||
|
Loading…
x
Reference in New Issue
Block a user