Panda3D
|
Classes | |
class | ArgumentError |
class | class_p3d |
class | class_package |
class | class_solo |
class | func_closure |
class | metaclass_def |
class | OutsideOfPackageError |
class | Packager |
class | PackagerError |
Functions | |
def | addFiles |
def | do_dir |
def | do_exclude |
def | do_file |
def | do_freeze |
def | do_makeBundle |
def | readContentsFile |
def | writeContentsFile |
Variables | |
contents | |
contentsChanged | |
contentsSeq | |
host | |
hosts | |
maxAge | |
string | p3dpythonName = 'p3dpython' |
string | p3dpythonwName = 'w' |
string | resources = '' |
# Find panda3d.icns in the models tree. | |
tuple | vfs = VirtualFileSystem.getGlobalPtr() |
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.
def p3d.Packager.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.
def p3d.Packager.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.
def p3d.Packager.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.)
def p3d.Packager.do_file | ( | self, | |
args, | |||
kw | |||
) |
Adds the indicated file or files to the current package. See addFiles().
def p3d.Packager.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.
def p3d.Packager.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.
def p3d.Packager.readContentsFile | ( | self | ) |
Reads the contents.xml file at the beginning of processing.
def p3d.Packager.writeContentsFile | ( | self | ) |
Rewrites the contents.xml file at the end of processing.
string p3dpythonName = 'p3dpython' |
string p3dpythonwName = 'w' |
string resources = '' |
# 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)
tuple vfs = VirtualFileSystem.getGlobalPtr() |