# direct.p3d.PackageInfo¶

from direct.p3d.PackageInfo import PackageInfo


Deprecated since version 1.10.0: The p3d packaging system has been replaced with the new setuptools-based system. See the Distributing Panda3D Applications manual section.

Inheritance diagram

class PackageInfo(host, packageName, packageVersion, platform=None, solo=False, asMirror=False, perPlatform=False)[source]

Bases: object

This class represents a downloadable Panda3D package file that can be (or has been) installed into the current runtime. It is the Python equivalent of the P3DPackage class in the core API.

class InstallStep(func, bytes, factor, stepType)[source]

Bases: object

This class is one step of the installPlan list; it represents a single atomic piece of the installation step, and the relative effort of that piece. When the plan is executed, it will call the saved function pointer here.

__init__(self, func, bytes, factor, stepType)[source]
func(self)[source]

self.__funcPtr(self) will return a generator of tokens. This function defines a new generator that yields each of those tokens, but wraps each call into the nested generator within a pair of start/stop collector calls.

getEffort(self)[source]

Returns the relative amount of effort of this step.

getProgress(self)[source]

Returns the progress of this step, in the range 0..1.

UsageBasename = 'usage.xml'
__init__(self, host, packageName, packageVersion, platform=None, solo=False, asMirror=False, perPlatform=False)[source]
checkStatus(self)[source]

Checks the current status of the desc file and the package contents on disk.

downloadDescFile(self, http)[source]

Downloads the desc file for this particular package, synchronously, and then reads it. Returns true on success, false on failure.

downloadDescFileGenerator(self, http)[source]

A generator function that implements downloadDescFile() one piece at a time. It yields one of stepComplete, stepFailed, or stepContinue.

downloadFactor = 1
downloadPackage(self, http)[source]

Downloads the package file, synchronously, then uncompresses and unpacks it. Returns true on success, false on failure.

This assumes that self.installPlans has already been filled in, which will have been done by self.__readDescFile().

downloadPackageGenerator(self, http)[source]

A generator function that implements downloadPackage() one piece at a time. It yields one of stepComplete, stepFailed, or stepContinue.

getDownloadEffort(self)[source]

Returns the relative amount of effort it will take to download this package. The units are meaningless, except relative to other packges.

getFormattedName(self)[source]

Returns the name of this package, for output to the user. This will be the “public” name of the package, as formatted for user consumption; it will include capital letters and spaces where appropriate.

getPackageDir(self)[source]

Returns the directory in which this package is installed. This may not be known until the host’s contents.xml file has been downloaded, which informs us of the host’s own install directory.

getPrevDownloadedEffort(self)[source]

getUsage(self)[source]

Returns the xusage element that is read from the usage.xml file, or None if there is no usage.xml file.

hasCurrentDescFile(self)[source]

Returns true if a desc file file has been successfully read for this package and is still current, false otherwise.

installPackage(self, appRunner)[source]

Mounts the package and sets up system paths so it becomes available for use. Returns true on success, false on failure.

markUsed(self)[source]

Marks the package as having been used. This is normally called automatically by installPackage().

notify = <direct.directnotify.Notifier.Notifier object>
patchFactor = 0.01
restartDownload = 3
setupFilenames(self)[source]

This is called by the HostInfo when the package is read from contents.xml, to set up the internal filenames and such that rely on some of the information from contents.xml.

stepComplete = 1
stepContinue = 4
stepFailed = 2
uncompressFactor = 0.01
unpackFactor = 0.01