diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 61d4c7019a..70903cf8f6 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -6,6 +6,7 @@ import sys import os import marshal import imp +import struct import direct from pandac.PandaModules import * @@ -540,8 +541,7 @@ class Freezer: def mangleName(self, moduleName): return 'M_' + moduleName.replace('.', '__') - def generateCode(self, basename): - + def __getModuleNames(self): # Collect a list of all of the modules we will be explicitly # referencing. moduleNames = [] @@ -560,6 +560,10 @@ class Freezer: if prevToken != self.MTForbid: moduleNames.append(moduleName) + moduleNames.sort() + return moduleNames + + def __replacePaths(self): # Build up the replacement pathname table, so we can eliminate # the personal information in the frozen pathnames. The # actual filename we put in there is meaningful only for stack @@ -578,13 +582,68 @@ class Freezer: co = self.mf.replace_paths_in_code(module.__code__) module.__code__ = co; - # Now generate the actual export table. - moduleNames.sort() + def __addPyc(self, mf, filename, code): + if code: + data = imp.get_magic() + \ + struct.pack('