Panda3D
Classes | Public Member Functions | Public Attributes | List of all members
Freezer Class Reference

Classes

class  ModuleDef
 

Public Member Functions

def __init__ (self, previous=None, debugLevel=0, platform=None)
 
def addModule (self, moduleName, implicit=False, newName=None, filename=None, guess=False, fromSource=None, text=None)
 
def addToMultifile (self, multifile, compressionLevel=0)
 
def done (self, compileToExe=False)
 
def excludeFrom (self, freezer)
 
def excludeModule (self, moduleName, forbid=False, allowChildren=False, fromSource=None)
 
def generateCode (self, basename, compileToExe=False)
 
def getAllModuleNames (self)
 
def getModuleDefs (self)
 
def getModulePath (self, moduleName)
 
def getModuleStar (self, moduleName)
 
def handleCustomPath (self, moduleName)
 
def makeForbiddenModuleListEntry (self, moduleName)
 
def makeModuleDef (self, mangledName, code)
 
def makeModuleListEntry (self, mangledName, code, moduleName, module)
 
def mangleName (self, moduleName)
 
def reset (self)
 
def writeMultifile (self, mfname)
 

Public Attributes

 cenv
 
 extras
 
 frozenDllMainCode
 
 frozenExtensions
 
 frozenMainCode
 
 keepTemporaryFiles
 
 mainInitCode
 
 mf
 
 modules
 
 objectExtension
 
 platform
 
 previousModules
 
 sourceExtension
 
 storePythonSource
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  previous = None,
  debugLevel = 0,
  platform = None 
)

Member Function Documentation

◆ addModule()

def addModule (   self,
  moduleName,
  implicit = False,
  newName = None,
  filename = None,
  guess = False,
  fromSource = None,
  text = None 
)
Adds a module to the list of modules to be exported by
this tool.  If implicit is true, it is OK if the module does
not actually exist.

newName is the name to call the module when it appears in the
output.  The default is the same name it had in the original.
Use caution when renaming a module; if another module imports
this module by its original name, you will also need to
explicitly add the module under its original name, duplicating
the module twice in the output.

The module name may end in ".*", which means to add all of the
.py files (other than __init__.py) in a particular directory.
It may also end in ".*.*", which means to cycle through all
directories within a particular directory.

◆ addToMultifile()

def addToMultifile (   self,
  multifile,
  compressionLevel = 0 
)
After a call to done(), this stores all of the accumulated
python code into the indicated Multifile.  Additional
extension modules are listed in self.extras.  

◆ done()

def done (   self,
  compileToExe = False 
)
Call this method after you have added all modules with
addModule().  You may then call generateCode() or
writeMultifile() to dump the resulting output.  After a call
to done(), you may not add any more modules until you call
reset(). 

◆ excludeFrom()

def excludeFrom (   self,
  freezer 
)
Excludes all modules that have already been processed by
the indicated FreezeTool.  This is equivalent to passing the
indicated FreezeTool object as previous to this object's
constructor, but it may be called at any point during
processing. 

◆ excludeModule()

def excludeModule (   self,
  moduleName,
  forbid = False,
  allowChildren = False,
  fromSource = None 
)
Adds a module to the list of modules not to be exported by
this tool.  If forbid is true, the module is furthermore
forbidden to be imported, even if it exists on disk.  If
allowChildren is true, the children of the indicated module
may still be included.

◆ generateCode()

def generateCode (   self,
  basename,
  compileToExe = False 
)
After a call to done(), this freezes all of the
accumulated python code into either an executable program (if
compileToExe is true) or a dynamic library (if compileToExe is
false).  The basename is the name of the file to write,
without the extension.

The return value is the newly-generated filename, including
the filename extension.  Additional extension modules are
listed in self.extras. 

◆ getAllModuleNames()

def getAllModuleNames (   self)
Return a list of all module names that have been included
or forbidden, either in this current pass or in a previous
pass.  Module names that have been excluded are not included
in this list. 

◆ getModuleDefs()

def getModuleDefs (   self)
Return a list of all of the modules we will be explicitly
or implicitly including.  The return value is actually a list
of tuples: (moduleName, moduleDef).

◆ getModulePath()

def getModulePath (   self,
  moduleName 
)
Looks for the indicated directory module and returns the
__path__ member: the list of directories in which its python
files can be found.  If the module is a .py file and not a
directory, returns None. 

◆ getModuleStar()

def getModuleStar (   self,
  moduleName 
)
Looks for the indicated directory module and returns the
__all__ member: the list of symbols within the module. 

◆ handleCustomPath()

def handleCustomPath (   self,
  moduleName 
)
Indicates a module that may perform runtime manipulation
of its __path__ variable, and which must therefore be actually
imported at runtime in order to determine the true value of
__path__. 

◆ makeForbiddenModuleListEntry()

def makeForbiddenModuleListEntry (   self,
  moduleName 
)

◆ makeModuleDef()

def makeModuleDef (   self,
  mangledName,
  code 
)

◆ makeModuleListEntry()

def makeModuleListEntry (   self,
  mangledName,
  code,
  moduleName,
  module 
)

◆ mangleName()

def mangleName (   self,
  moduleName 
)

◆ reset()

def reset (   self)
After a previous call to done(), this resets the
FreezeTool object for a new pass.  More modules may be added
and dumped to a new target.  Previously-added modules are
remembered and will not be dumped again. 

◆ writeMultifile()

def writeMultifile (   self,
  mfname 
)
After a call to done(), this stores all of the accumulated
python code into a Multifile with the indicated filename,
including the extension.  Additional extension modules are
listed in self.extras.

Member Data Documentation

◆ cenv

cenv

◆ extras

extras

◆ frozenDllMainCode

frozenDllMainCode

◆ frozenExtensions

frozenExtensions

◆ frozenMainCode

frozenMainCode

◆ keepTemporaryFiles

keepTemporaryFiles

◆ mainInitCode

mainInitCode

◆ mf

mf

◆ modules

modules

◆ objectExtension

objectExtension

◆ platform

platform

◆ previousModules

previousModules

◆ sourceExtension

sourceExtension

◆ storePythonSource

storePythonSource