Panda3D

Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
PackageInfo Class Reference

## Classes
class | InstallStep

## Public Member Functions
| __init__ (self, host, packageName, packageVersion, platform=None, solo=False, asMirror=False, perPlatform=False)
| checkStatus (self)
| downloadDescFile (self, http)
| downloadDescFileGenerator (self, http)
| downloadPackage (self, http)
| downloadPackageGenerator (self, http)
| getDownloadEffort (self)
| getFormattedName (self)
| getPackageDir (self)
| getPrevDownloadedEffort (self)
| getUsage (self)
| hasCurrentDescFile (self)
| installPackage (self, appRunner)
| markUsed (self)
| setupFilenames (self)

## Public Attributes
| asMirror = asMirror
| compressedArchive = None
| currentStepEffort = step.getEffort()
| descFile = None
| descFileBasename = basename
| descFileDirname = dirname
| diskSpace = None
| displayName = None
int | downloadProgress = 0
list | extracts = []
bool | guiApp = False
bool | hasDescFile = False
bool | hasPackage = False
| host = host
| http = None
| importDescFile = None
bool | installed = False
list | installPlans = None
| packageDir = None
| packageName = packageName
| packageVersion = packageVersion
| patchVersion = None
| perPlatform = perPlatform
| platform = platform
list | requires = []
| solo = solo
int | totalPlanCompleted = 0
| totalPlanSize = sum([step.getEffort() for step in plan])
| uncompressedArchive = None
bool | updated = False

## Static Public Attributes
int | downloadFactor = 1
| notify = directNotify.newCategory("PackageInfo")
float | patchFactor = 0.01
int | restartDownload = 3
int | stepComplete = 1
int | stepContinue = 4
int | stepFailed = 2
float | uncompressFactor = 0.01
float | unpackFactor = 0.01
str | UsageBasename = 'usage.xml'

## Detailed Description

     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.

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self,
|  |  | host,
|  |  | packageName,
|  |  | packageVersion,
|  |  | platform = None,
|  |  | solo = False,
|  |  | asMirror = False,
|  |  | perPlatform = False )

## Member Function Documentation

## ◆ checkStatus()

checkStatus | ( |  | self | ) |

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

## ◆ downloadDescFile()

downloadDescFile | ( |  | self,
|  |  | http )

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

## ◆ downloadDescFileGenerator()

downloadDescFileGenerator | ( |  | self,
|  |  | http )

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

## ◆ downloadPackage()

downloadPackage | ( |  | self,
|  |  | http )

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

downloadPackageGenerator | ( |  | self,
|  |  | http )

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

## ◆ getDownloadEffort()

getDownloadEffort | ( |  | self | ) |

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

## ◆ getFormattedName()

getFormattedName | ( |  | self | ) |

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

getPackageDir | ( |  | self | ) |

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

getPrevDownloadedEffort | ( |  | self | ) |

     Returns a rough estimate of this package's total download
    effort, even if it is already downloaded.

## ◆ getUsage()

getUsage | ( |  | self | ) |

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

## ◆ hasCurrentDescFile()

hasCurrentDescFile | ( |  | self | ) |

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

## ◆ installPackage()

installPackage | ( |  | self,
|  |  | appRunner )

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

## ◆ markUsed()

markUsed | ( |  | self | ) |

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

## ◆ setupFilenames()

setupFilenames | ( |  | self | ) |

     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.

## Member Data Documentation

## ◆ asMirror

asMirror = asMirror

## ◆ compressedArchive

compressedArchive = None

## ◆ currentStepEffort

currentStepEffort = step.getEffort()

## ◆ descFile

descFile = None

## ◆ descFileBasename

descFileBasename = basename

## ◆ descFileDirname

descFileDirname = dirname

## ◆ diskSpace

diskSpace = None

## ◆ displayName

displayName = None

## ◆ downloadFactor

int downloadFactor = 1
| static

## ◆ downloadProgress

int downloadProgress = 0

## ◆ extracts

extracts = []

## ◆ guiApp

bool guiApp = False

## ◆ hasDescFile

bool hasDescFile = False

## ◆ hasPackage

bool hasPackage = False

## ◆ host

host = host

## ◆ http

http = None

## ◆ importDescFile

importDescFile = None

## ◆ installed

bool installed = False

## ◆ installPlans

list installPlans = None

## ◆ notify

notify = directNotify.newCategory("PackageInfo")
| static

## ◆ packageDir

packageDir = None

## ◆ packageName

packageName = packageName

## ◆ packageVersion

packageVersion = packageVersion

## ◆ patchFactor

float patchFactor = 0.01
| static

## ◆ patchVersion

patchVersion = None

## ◆ perPlatform

perPlatform = perPlatform

## ◆ platform

platform = platform

## ◆ requires

list requires = []

## ◆ restartDownload

int restartDownload = 3
| static

## ◆ solo

solo = solo

## ◆ stepComplete

int stepComplete = 1
| static

## ◆ stepContinue

int stepContinue = 4
| static

## ◆ stepFailed

int stepFailed = 2
| static

## ◆ totalPlanCompleted

int totalPlanCompleted = 0

## ◆ totalPlanSize

totalPlanSize = sum([step.getEffort() for step in plan])

## ◆ uncompressedArchive

uncompressedArchive = None

## ◆ uncompressFactor

float uncompressFactor = 0.01
| static

## ◆ unpackFactor

float unpackFactor = 0.01
| static

## ◆ updated

bool updated = False

## ◆ UsageBasename

UsageBasename = 'usage.xml'
| static