Panda3D
Classes | Public Member Functions | Public Attributes

Freezer Class Reference

List of all members.

Classes

class  ModuleDef

Public Member Functions

def __init__
def addModule
def addToMultifile
def done
def excludeFrom
def excludeModule
def generateCode
def getAllModuleNames
def getModuleDefs
def getModulePath
def getModuleStar
def handleCustomPath
def makeForbiddenModuleListEntry
def makeModuleDef
def makeModuleListEntry
def mangleName
def reset
def writeMultifile

Public Attributes

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

Constructor & Destructor Documentation

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

Member Function Documentation

def addModule (   self,
  moduleName,
  implicit = False,
  newName = None,
  filename = None,
  guess = False,
  fromSource = 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.
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.  
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(). 
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. 
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.
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. 
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. 
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).
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. 
def getModuleStar (   self,
  moduleName 
)
Looks for the indicated directory module and returns the
__all__ member: the list of symbols within the module. 
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__. 
def makeForbiddenModuleListEntry (   self,
  moduleName 
)
def makeModuleDef (   self,
  mangledName,
  code 
)
def makeModuleListEntry (   self,
  mangledName,
  code,
  moduleName,
  module 
)
def mangleName (   self,
  moduleName 
)
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. 
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

mf
 All Classes Namespaces Functions Variables Properties