Classes | Functions | Variables
direct.p3d.Packager Namespace Reference


class  ArgumentError
class  func_closure
class  metaclass_def
class  OutsideOfPackageError
class  Packager
class  PackagerError


def addFiles (self, filenames, text=None, newName=None, newDir=None, extract=None, executable=None, deleteTemp=False, literal=False, dependencyDir=None, required=False)
def do_dir (self, dirname, newDir=None, unprocessed=None)
def do_exclude (self, filename)
def do_file (self, *args, **kw)
def do_freeze (self, filename, compileToExe=False)
def do_includeExtensions (self, executableExtensions=None, extractExtensions=None, imageExtensions=None, textExtensions=None, uncompressibleExtensions=None, unprocessedExtensions=None, suppressWarningForExtensions=None)
def do_makeBundle (self, bundleName, plist, executable=None, resources=None, dependencyDir=None)
def readContentsFile (self)
def writeContentsFile (self)


 class_p3d = metaclass_def(str('class_p3d'), (), {})
 class_package = metaclass_def(str('class_package'), (), {})
 class_solo = metaclass_def(str('class_solo'), (), {})
string p3dpythonName = 'p3dpython'
string p3dpythonwName = p3dpythonName+'w'
 vfs = VirtualFileSystem.getGlobalPtr()

Detailed Description

This module is used to build a "Package", a collection of files
within a Panda3D Multifile, which can be easily be downloaded and/or
patched onto a client machine, for the purpose of running a large

Function Documentation

◆ addFiles()

def direct.p3d.Packager.addFiles (   self,
  text = None,
  newName = None,
  newDir = None,
  extract = None,
  executable = None,
  deleteTemp = False,
  literal = False,
  dependencyDir = None,
  required = False 
Adds the indicated arbitrary files to the current package.

filenames is a list of Filename or string objects, and each
may include shell globbing characters.

Each file is placed in the named directory, or the toplevel
directory if no directory is specified.

Certain special behavior is invoked based on the filename
extension.  For instance, .py files may be automatically
compiled and stored as Python modules.

If newDir is not None, it specifies the directory in which the
file should be placed.  In this case, all files matched by the
filename expression are placed in the named directory.

If newName is not None, it specifies a new filename.  In this
case, newDir is ignored, and the filename expression must
match only one file.

If newName and newDir are both None, the file is placed in the
toplevel directory, regardless of its source directory.

If text is nonempty, it contains the text of the file.  In
this case, the filename is not read, but the supplied text is
used instead.

If extract is true, the file is explicitly extracted at

If executable is true, the file is marked as an executable
filename, for special treatment.

If deleteTemp is true, the file is a temporary file and will
be deleted after its contents are copied to the package.

If literal is true, then the file extension will be respected
exactly as it appears, and glob characters will not be
expanded.  If this is false, then .dll or .exe files will be
renamed to .dylib and no extension on OSX (or .so on Linux);
and glob characters will be expanded.

If required is true, then the file is marked a vital part of
the package.  The package will not be built if this file
somehow cannot be added to the package.

◆ do_dir()

def direct.p3d.Packager.do_dir (   self,
  newDir = None,
  unprocessed = None 
Adds the indicated directory hierarchy to the current
package.  The directory hierarchy is walked recursively, and
all files that match a known extension are added to the package.

newDir specifies the directory name within the package which
the contents of the named directory should be installed to.
If it is omitted, the contents of the named directory are
installed to the root of the package.

If unprocessed is false (the default), bam files are loaded and
scanned for textures, and these texture paths within the bam
files are manipulated to point to the new paths within the
package.  If unprocessed is true, this operation is bypassed,
and bam files are packed exactly as they are.

◆ do_exclude()

def direct.p3d.Packager.do_exclude (   self,
Marks the indicated filename as not to be included.  The
filename may include shell globbing characters, and may or may
not include a dirname.  (If it does not include a dirname, it
refers to any file with the given basename from any

◆ do_file()

def direct.p3d.Packager.do_file (   self,
**  kw 
Adds the indicated file or files to the current package.
See addFiles(). 

◆ do_freeze()

def direct.p3d.Packager.do_freeze (   self,
  compileToExe = False 
Freezes all of the current Python code into either an
executable (if compileToExe is true) or a dynamic library (if
it is false).  The resulting compiled binary is added to the
current package under the indicated filename.  The filename
should not include an extension; that will be added. 

◆ do_includeExtensions()

def direct.p3d.Packager.do_includeExtensions (   self,
  executableExtensions = None,
  extractExtensions = None,
  imageExtensions = None,
  textExtensions = None,
  uncompressibleExtensions = None,
  unprocessedExtensions = None,
  suppressWarningForExtensions = None 
Ensure that dir() will include files with the given extensions.
The extensions should not have '.' prefixes.

All except 'suppressWarningForExtensions' allow the given kinds of files
to be packaged with their respective semantics (read the source).

'suppressWarningForExtensions' lists extensions *expected* to be ignored,
so no warnings will be emitted for them.

◆ do_makeBundle()

def direct.p3d.Packager.do_makeBundle (   self,
  executable = None,
  resources = None,
  dependencyDir = None 
Constructs a minimal OSX "bundle" consisting of an
executable and a plist file, with optional resource files
(such as icons), and adds it to the package under the given

◆ readContentsFile()

def direct.p3d.Packager.readContentsFile (   self)
Reads the contents.xml file at the beginning of

◆ writeContentsFile()

def direct.p3d.Packager.writeContentsFile (   self)
Rewrites the contents.xml file at the end of

Variable Documentation

◆ class_p3d

class_p3d = metaclass_def(str('class_p3d'), (), {})

◆ class_package

class_package = metaclass_def(str('class_package'), (), {})

◆ class_solo

class_solo = metaclass_def(str('class_solo'), (), {})

◆ contents


◆ contentsChanged


◆ contentsSeq


◆ dependencyDir


◆ executable


◆ host


◆ hosts


◆ maxAge


◆ newName


◆ p3dpython_name


◆ p3dpythonName

string p3dpythonName = 'p3dpython'

◆ p3dpythonw_name


◆ p3dpythonwName

string p3dpythonwName = p3dpythonName+'w'

◆ plist


Find panda3d.icns in the models tree.

filename = Filename('plugin_images/panda3d.icns') found = filename.resolveFilename(getModelPath().getValue()) if not found: found = filename.resolveFilename("models") if found: resources.append(filename)

◆ resources


◆ vfs