mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
pzip: use Python zlib module to perform pzip step
This is more useful when cross-compiling, not requiring a functional pzip binary on the host.
This commit is contained in:
parent
7ae72cd880
commit
1a5fd04499
@ -30,6 +30,11 @@ import time
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
import zlib
|
||||||
|
except:
|
||||||
|
zlib = None
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
##
|
##
|
||||||
## PARSING THE COMMAND LINE OPTIONS
|
## PARSING THE COMMAND LINE OPTIONS
|
||||||
@ -1904,7 +1909,11 @@ def CompileEgg(eggfile, src, opts):
|
|||||||
oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
|
oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
|
||||||
|
|
||||||
if pz:
|
if pz:
|
||||||
oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
|
if zlib:
|
||||||
|
WriteBinaryFile(eggfile + '.pz', zlib.compress(ReadBinaryFile(eggfile)))
|
||||||
|
os.remove(eggfile)
|
||||||
|
else:
|
||||||
|
oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
|
||||||
|
|
||||||
##########################################################################################
|
##########################################################################################
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user