Panda3D
Loading...
Searching...
No Matches
Packager Class Reference

Classes

class  ExcludeFilename
 
class  HostEntry
 
class  Package
 
class  PackageEntry
 
class  PackFile
 

Public Member Functions

 __init__ (self, platform=None)
 
 addAltHost (self, keyword, altHost, origHost=None, downloadUrl=None, descriptiveName=None, hostDir=None, mirrors=None)
 
 addHost (self, host, downloadUrl=None, descriptiveName=None, hostDir=None, mirrors=None)
 
 addModule (self, moduleNames, newName=None, filename=None, required=False)
 
 addPosixSearchPath (self, searchPath, varname)
 
 addWindowsSearchPath (self, searchPath, varname)
 
 beginPackage (self, packageName, p3dApplication=False, solo=False)
 
 buildPatches (self, packages)
 
 close (self)
 
 do_config (self, **kw)
 
 do_excludeModule (self, *args)
 
 do_main (self, filename)
 
 do_mainModule (self, moduleName, newName=None, filename=None)
 
 do_module (self, *args, **kw)
 
 do_require (self, *args, **kw)
 
 do_setupPanda3D (self, p3dpythonName=None, p3dpythonwName=None)
 
 do_setVer (self, value)
 
 do_sign (self, certificate, chain=None, pkey=None, password=None)
 
 endPackage (self)
 
 findPackage (self, packageName, platform=None, version=None, host=None, requires=None)
 
 loadLdconfigCache (self)
 
 readPackageDef (self, packageDef, packageNames=None)
 
 requirePackage (self, package)
 
 requirePackagesNamed (self, names, version=None, host=None)
 
 resolveLibrary (self, filename)
 
 setHost (self, host, downloadUrl=None, descriptiveName=None, hostDir=None, mirrors=None)
 
 setPlatform (self, platform=None)
 
 setup (self)
 

Public Attributes

bool allowPackages = True
 
bool allowPythonDev = False
 
 arch = None
 
list binaryExtensions = [ 'ttf', 'TTF', 'mid', 'ico', 'cur' ]
 
bool caseSensitive = True
 
dict contents = {}
 
 contentsSeq = SeqValue()
 
 currentPackage = None
 
list dcClientSuffixes = ['OV']
 
 encryptionKey = None
 
list excludeSystemFiles
 
list excludeSystemGlobs
 
list executableExtensions = [ 'dll', 'pyd', 'exe' ]
 
 executablePath = DSearchPath()
 
list extractExtensions = self.executableExtensions[:] + self.manifestExtensions[:] + [ 'ico', 'cur' ]
 
 host = PandaSystem.getPackageHostUrl()
 
dict hosts = {}
 
 http = HTTPClient.getGlobalPtr()
 
bool ignoreSetHost = False
 
list imageExtensions = []
 
 installDir = None
 
 installSearch = list(map(Filename, cvar.getDirectories()))
 
list knownExtensions
 
dict libraryCache = {}
 
 loader = Loader.Loader(self)
 
 loaderOptions = opts
 
list manifestExtensions = [ 'manifest' ]
 
int maxAge = 0
 
list modelExtensions = [ 'egg', 'bam' ]
 
 musicManager = None
 
list nonuniqueExtensions = [ 'prc' ]
 
str p3dInstallDir = self.installDir
 
str p3dSuffix = ''
 
list packageList = []
 
dict packages = {}
 
 platform = platform or PandaSystem.getPlatform()
 
list platformSpecificExtensions = self.executableExtensions[:]
 
 prcEncryptionKey = None
 
 prcSignCommand = None
 
dict remapExtensions = {}
 
 sfxManagerList = None
 
list signParams = []
 
bool storePythonSource = False
 
list suppressWarningForExtensions
 
 systemRoot = None
 
list textExtensions = [ 'prc', 'ptf', 'txt', 'cg', 'sha', 'dc', 'xml' ]
 
list uncompressibleExtensions = [ 'mp3', 'ogg', 'ogv', 'wav', 'rml', 'rcss', 'otf' ]
 
list unprocessedExtensions = []
 
bool verbosePrint = False
 

Static Public Attributes

 notify = directNotify.newCategory("Packager")
 

Protected Member Functions

 _ensureExtensions (self)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
platform = None )

Member Function Documentation

◆ _ensureExtensions()

_ensureExtensions ( self)
protected

◆ addAltHost()

addAltHost ( self,
keyword,
altHost,
origHost = None,
downloadUrl = None,
descriptiveName = None,
hostDir = None,
mirrors = None )
 Adds an alternate host to any already-known host.  This
defines an alternate server that may be contacted, if
specified on the HTML page, which hosts a different version of
the server's contents.  (This is different from a mirror,
which hosts an identical version of the server's contents.)

◆ addHost()

addHost ( self,
host,
downloadUrl = None,
descriptiveName = None,
hostDir = None,
mirrors = None )
 Adds a host to the list of known download hosts.  This
information will be written into any p3d files that reference
this host; this can be used to pre-define the possible mirrors
for a given host, for instance.  Returns the newly-created
HostEntry object.

◆ addModule()

addModule ( self,
moduleNames,
newName = None,
filename = None,
required = False )

◆ addPosixSearchPath()

addPosixSearchPath ( self,
searchPath,
varname )
 Expands $varname, interpreting as a Posix-style search
path, and adds its contents to the indicated DSearchPath. 

◆ addWindowsSearchPath()

addWindowsSearchPath ( self,
searchPath,
varname )
 Expands $varname, interpreting as a Windows-style search
path, and adds its contents to the indicated DSearchPath. 

◆ beginPackage()

beginPackage ( self,
packageName,
p3dApplication = False,
solo = False )
 Begins a new package specification.  packageName is the
basename of the package.  Follow this with a number of calls
to file() etc., and close the package with endPackage(). 

◆ buildPatches()

buildPatches ( self,
packages )
 Call this after calling close(), to build patches for the
indicated packages. 

◆ close()

close ( self)
 Called after reading all of the package def files, this
performs any final cleanup appropriate. 

◆ do_config()

do_config ( self,
** kw )
 Called with any number of keyword parameters.  For each
keyword parameter, sets the corresponding p3d config variable
to the given value.  This will be written into the
p3d_info.xml file at the top of the application, or to the
package desc file for a package file. 

◆ do_excludeModule()

do_excludeModule ( self,
* args )
 Marks the indicated Python module as not to be included. 

◆ do_main()

do_main ( self,
filename )
 Includes the indicated file as __main__ module of the application.
Also updates mainModule to point to this module. 

◆ do_mainModule()

do_mainModule ( self,
moduleName,
newName = None,
filename = None )
 Names the indicated module as the "main" module of the
application or exe.  In most cases, you will want to use main()
instead. 

◆ do_module()

do_module ( self,
* args,
** kw )
 Adds the indicated Python module(s) to the current package. 

◆ do_require()

do_require ( self,
* args,
** kw )
 Indicates a dependency on the named package(s), supplied
as a name.

Attempts to install this package will implicitly install the
named package also.  Files already included in the named
package will be omitted from this one when building it. 

◆ do_setupPanda3D()

do_setupPanda3D ( self,
p3dpythonName = None,
p3dpythonwName = None )
 A special convenience command that adds the minimum
startup modules for a panda3d package, intended for developers
producing their own custom panda3d for download.  Should be
called before any other Python modules are named. 

◆ do_setVer()

do_setVer ( self,
value )
 Sets an explicit set_ver number for the package, as a tuple
of integers, or as a string of dot-separated integers. 

◆ do_sign()

do_sign ( self,
certificate,
chain = None,
pkey = None,
password = None )
 Signs the resulting p3d file (or package multifile) with
the indicated certificate.  If needed, the chain file should
contain the list of additional certificate authorities needed
to validate the signing certificate.  The pkey file should
contain the private key.

It is also legal for the certificate file to contain the chain
and private key embedded within it.

If the private key is encrypted, the password should be
supplied. 

◆ endPackage()

endPackage ( self)
 Closes the current package specification.  This actually
generates the package file.  Returns the finished package,
or None if the package failed to close (e.g. missing files). 

◆ findPackage()

findPackage ( self,
packageName,
platform = None,
version = None,
host = None,
requires = None )
 Searches for the named package from a previous publish
operation along the install search path.

If requires is not None, it is a list of Package objects that
are already required.  The new Package object must be
compatible with the existing Packages, or an error is
returned.  This is also useful for determining the appropriate
package version to choose when a version is not specified.

Returns the Package object, or None if the package cannot be
located. 

◆ loadLdconfigCache()

loadLdconfigCache ( self)
 On GNU/Linux, runs ldconfig -p to find out where all the
libraries on the system are located.  Assumes that the platform
has already been set. 

◆ readPackageDef()

readPackageDef ( self,
packageDef,
packageNames = None )
 Reads the named .pdef file and constructs the named
packages, or all packages if packageNames is None.  Raises an
exception if the pdef file is invalid.  Returns the list of
packages constructed. 

◆ requirePackage()

requirePackage ( self,
package )
 Indicates a dependency on the indicated package, supplied
as a Package object.

Attempts to install this package will implicitly install the
named package also.  Files already included in the named
package will be omitted from this one. 

◆ requirePackagesNamed()

requirePackagesNamed ( self,
names,
version = None,
host = None )
 Indicates a dependency on the named package(s), supplied
as a name.

Attempts to install this package will implicitly install the
named package also.  Files already included in the named
package will be omitted from this one when building it. 

◆ resolveLibrary()

resolveLibrary ( self,
filename )
 Resolves the given shared library filename along the executable path,
or by cross-referencing it with the library cache. 

◆ setHost()

setHost ( self,
host,
downloadUrl = None,
descriptiveName = None,
hostDir = None,
mirrors = None )
 Specifies the URL that will ultimately host these
contents. 

◆ setPlatform()

setPlatform ( self,
platform = None )
 Sets the platform that this Packager will compute for.  On
OSX, this can be used to specify the particular architecture
we are building; on other platforms, it is probably a mistake
to set this.

You should call this before doing anything else with the
Packager.  It's even better to pass the platform string to the
constructor.  

◆ setup()

setup ( self)
 Call this method to initialize the class after filling in
some of the values in the constructor. 

Member Data Documentation

◆ allowPackages

bool allowPackages = True

◆ allowPythonDev

bool allowPythonDev = False

◆ arch

arch = None

◆ binaryExtensions

list binaryExtensions = [ 'ttf', 'TTF', 'mid', 'ico', 'cur' ]

◆ caseSensitive

bool caseSensitive = True

◆ contents

dict contents = {}

◆ contentsSeq

contentsSeq = SeqValue()

◆ currentPackage

currentPackage = None

◆ dcClientSuffixes

list dcClientSuffixes = ['OV']

◆ encryptionKey

encryptionKey = None

◆ excludeSystemFiles

list excludeSystemFiles
Initial value:
= [
'kernel32.dll', 'user32.dll', 'wsock32.dll', 'ws2_32.dll',
'advapi32.dll', 'opengl32.dll', 'glu32.dll', 'gdi32.dll',
'shell32.dll', 'ntdll.dll', 'ws2help.dll', 'rpcrt4.dll',
'imm32.dll', 'ddraw.dll', 'shlwapi.dll', 'secur32.dll',
'dciman32.dll', 'comdlg32.dll', 'comctl32.dll', 'ole32.dll',
'oleaut32.dll', 'gdiplus.dll', 'winmm.dll', 'iphlpapi.dll',
'msvcrt.dll', 'kernelbase.dll', 'msimg32.dll', 'msacm32.dll',
'libsystem.b.dylib', 'libmathcommon.a.dylib', 'libmx.a.dylib',
'libstdc++.6.dylib', 'libobjc.a.dylib', 'libauto.dylib',
]

◆ excludeSystemGlobs

list excludeSystemGlobs
Initial value:
= [
GlobPattern('d3dx9_*.dll'),
GlobPattern('api-ms-win-*.dll'),
GlobPattern('libGL.so*'),
GlobPattern('libGLU.so*'),
GlobPattern('libGLcore.so*'),
GlobPattern('libGLES*.so*'),
GlobPattern('libEGL.so*'),
GlobPattern('libX11.so*'),
GlobPattern('libXau.so*'),
GlobPattern('libXdmcp.so*'),
GlobPattern('libxcb*.so*'),
GlobPattern('libc.so*'),
GlobPattern('libgcc_s.so*'),
GlobPattern('libdl.so*'),
GlobPattern('libm.so*'),
GlobPattern('libnvidia*.so*'),
GlobPattern('libpthread.so*'),
GlobPattern('libthr.so*'),
GlobPattern('ld-linux.so*'),
GlobPattern('ld-linux-*.so*'),
GlobPattern('librt.so*'),
]

◆ executableExtensions

list executableExtensions = [ 'dll', 'pyd', 'exe' ]

◆ executablePath

executablePath = DSearchPath()

◆ extractExtensions

list extractExtensions = self.executableExtensions[:] + self.manifestExtensions[:] + [ 'ico', 'cur' ]

◆ host

host = PandaSystem.getPackageHostUrl()

◆ hosts

dict hosts = {}

◆ http

http = HTTPClient.getGlobalPtr()

◆ ignoreSetHost

bool ignoreSetHost = False

◆ imageExtensions

list imageExtensions = []

◆ installDir

installDir = None

◆ installSearch

installSearch = list(map(Filename, cvar.getDirectories()))

◆ knownExtensions

list knownExtensions
Initial value:
= \
self.imageExtensions + \
self.modelExtensions + \
self.textExtensions + \
self.binaryExtensions + \
self.uncompressibleExtensions + \
self.unprocessedExtensions

◆ libraryCache

dict libraryCache = {}

◆ loader

loader = Loader.Loader(self)

◆ loaderOptions

loaderOptions = opts

◆ manifestExtensions

list manifestExtensions = [ 'manifest' ]

◆ maxAge

int maxAge = 0

◆ modelExtensions

list modelExtensions = [ 'egg', 'bam' ]

◆ musicManager

musicManager = None

◆ nonuniqueExtensions

list nonuniqueExtensions = [ 'prc' ]

◆ notify

notify = directNotify.newCategory("Packager")
static

◆ p3dInstallDir

str p3dInstallDir = self.installDir

◆ p3dSuffix

str p3dSuffix = ''

◆ packageList

list packageList = []

◆ packages

dict packages = {}

◆ platform

platform = platform or PandaSystem.getPlatform()

◆ platformSpecificExtensions

list platformSpecificExtensions = self.executableExtensions[:]

◆ prcEncryptionKey

prcEncryptionKey = None

◆ prcSignCommand

prcSignCommand = None

◆ remapExtensions

dict remapExtensions = {}

◆ sfxManagerList

sfxManagerList = None

◆ signParams

list signParams = []

◆ storePythonSource

bool storePythonSource = False

◆ suppressWarningForExtensions

list suppressWarningForExtensions
Initial value:
= ['', 'pyc', 'pyo',
'p3d', 'pdef',
'c', 'C', 'cxx', 'cpp', 'h', 'H',
'hpp', 'pp', 'I', 'pem', 'p12', 'crt',
'o', 'obj', 'a', 'lib', 'bc', 'll']

◆ systemRoot

systemRoot = None

◆ textExtensions

list textExtensions = [ 'prc', 'ptf', 'txt', 'cg', 'sha', 'dc', 'xml' ]

◆ uncompressibleExtensions

list uncompressibleExtensions = [ 'mp3', 'ogg', 'ogv', 'wav', 'rml', 'rcss', 'otf' ]

◆ unprocessedExtensions

list unprocessedExtensions = []

◆ verbosePrint

bool verbosePrint = False