direct.p3d.PackageInstaller

from direct.p3d.PackageInstaller import PackageInstaller

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

Inheritance diagram of direct.p3d.PackageInstaller

class PackageInstaller(appRunner, taskChain='default')[source]

Bases: direct.showbase.DirectObject.DirectObject

This class is used in a p3d runtime environment to manage the asynchronous download and installation of packages. If you just want to install a package synchronously, see appRunner.installPackage() for a simpler interface.

To use this class, you should subclass from it and override any of the six callback methods: downloadStarted(), packageStarted(), packageProgress(), downloadProgress(), packageFinished(), downloadFinished().

Also see DWBPackageInstaller, which does exactly this, to add a DirectWaitBar GUI.

class PendingPackage(packageName, version, host)[source]

Bases: object

This class describes a package added to the installer for download.

__init__(self, packageName, version, host)[source]
checkDescFile(self)[source]

Returns true if the desc file is already downloaded and good, or false if it needs to be downloaded.

getDescFile(self, http)[source]

Synchronously downloads the desc files required for the package.

getProgress(self)[source]

Returns the download progress of this package in the range 0..1.

notify = <direct.directnotify.Notifier.Notifier object>
S_done = 3
S_initial = 0
S_ready = 1
S_started = 2
__init__(self, appRunner, taskChain='default')[source]
addPackage(self, packageName, version=None, hostUrl=None)[source]

Adds the named package to the list of packages to be downloaded. Call donePackages() to finish the list.

cleanup(self)[source]

Interrupts all pending downloads. No further callbacks will be made.

destroy(self)[source]

Interrupts all pending downloads. No further callbacks will be made.

donePackages(self)[source]

After calling addPackage() for each package to be installed, call donePackages() to mark the end of the list. This is necessary to determine what the complete set of packages is (and therefore how large the total download size is). None of the low-level callbacks will be made before this call.

downloadFinished(self, success)[source]

This callback is made when all of the packages have been downloaded and installed (or there has been some failure). If all packages where successfully installed, success is True.

If there were no packages that required downloading, this callback will be made immediately, without a corresponding call to downloadStarted().

downloadProgress(self, overallProgress)[source]

This callback is made repeatedly between downloadStarted() and downloadFinished() to update the current progress through all packages. The progress value ranges from 0 (beginning) to 1 (complete).

downloadStarted(self)[source]

This callback is made at some point after donePackages() is called; at the time of this callback, the total download size is known, and we can sensibly report progress through the whole.

globalLock = Mutex 0x55ec94753840
nextUniqueId = 1
notify = <direct.directnotify.Notifier.Notifier object>
packageFinished(self, package, success)[source]

This callback is made for each package between downloadStarted() and downloadFinished() to indicate that a package has finished downloading. If success is true, there were no problems and the package is now installed.

If this package did not require downloading (because it was already downloaded), this callback will be made immediately, without a corresponding call to packageStarted(), and may even be made before downloadStarted().

packageProgress(self, package, progress)[source]

This callback is made repeatedly between packageStarted() and packageFinished() to update the current progress on the indicated package only. The progress value ranges from 0 (beginning) to 1 (complete).

packageStarted(self, package)[source]

This callback is made for each package between downloadStarted() and downloadFinished() to indicate the start of a new package.