Panda3D

Loading...
Searching...
No Matches
Classes | Functions | Variables
direct.p3d.Packager Namespace Reference

## Classes
class | ArgumentError
class | func_closure
class | metaclass_def
class | OutsideOfPackageError
class | Packager
class | PackagerError

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

## Variables
| allowPackages
| class_p3d = metaclass_def(str('class_p3d'), (), {})
| class_package = metaclass_def(str('class_package'), (), {})
| class_solo = metaclass_def(str('class_solo'), (), {})
dict | contents = {}
bool | contentsChanged = False
| contentsSeq = SeqValue()
| currentPackage
| dependencyDir
| executable
| host
dict | hosts = {}
| knownExtensions
int | maxAge = 0
| newName
| p3dpython_name
str | p3dpythonName = 'p3dpython'
| p3dpythonw_name
str | p3dpythonwName = p3dpythonName+'w'
| plist
| resources
| suppressWarningForExtensions = unprocessed)
| textExtensions
| verbosePrint = newCount
| 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
    application.

    .. deprecated:: 1.10.0
       The p3d packaging system has been replaced with the new setuptools-based
       system.  See the :ref:`distribution` manual section.

## Function Documentation

## ◆ addFiles()

addFiles | ( |  | self,
|  |  | filenames,
|  |  | 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
    runtime.

    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()

do_dir | ( |  | self,
|  |  | dirname,
|  |  | 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()

do_exclude | ( |  | self,
|  |  | filename )

     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
    directory.)

## ◆ do_file()

do_file | ( |  | self,
|  | * | args,
|  | ** | kw )

     Adds the indicated file or files to the current package.
    See addFiles().

## ◆ do_freeze()

do_freeze | ( |  | self,
|  |  | filename,
|  |  | 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()

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()

do_makeBundle | ( |  | self,
|  |  | bundleName,
|  |  | plist,
|  |  | 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
    name.

## ◆ readContentsFile()

readContentsFile | ( |  | self | ) |

     Reads the contents.xml file at the beginning of
    processing.

## ◆ writeContentsFile()

writeContentsFile | ( |  | self | ) |

     Rewrites the contents.xml file at the end of
    processing.

## Variable Documentation

## ◆ allowPackages

allowPackages

## ◆ 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

dict contents = {}

## ◆ contentsChanged

bool contentsChanged = False

## ◆ contentsSeq

contentsSeq = SeqValue()

## ◆ currentPackage

currentPackage

## ◆ dependencyDir

dependencyDir

## ◆ executable

executable

# 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)

## ◆ host

host

## ◆ hosts

dict hosts = {}

## ◆ knownExtensions

knownExtensions

## ◆ maxAge

maxAge = 0

## ◆ newName

newName

## ◆ p3dpython_name

p3dpython_name

## ◆ p3dpythonName

str p3dpythonName = 'p3dpython'

## ◆ p3dpythonw_name

p3dpythonw_name

## ◆ p3dpythonwName

str p3dpythonwName = p3dpythonName+'w'

## ◆ plist

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

resources

## ◆ suppressWarningForExtensions

suppressWarningForExtensions = unprocessed)

## ◆ textExtensions

textExtensions

## ◆ verbosePrint

verbosePrint = newCount

## ◆ vfs

vfs = VirtualFileSystem.getGlobalPtr()