Panda3D
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
PackageInfo Class Reference

Classes

class  InstallStep
 

Public Member Functions

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

Public Attributes

 asMirror
 
 compressedArchive
 
 currentStepEffort
 
 descFile
 
 descFileBasename
 
 descFileDirname
 
 diskSpace
 
 displayName
 
 downloadProgress
 
 extracts
 
 guiApp
 
 hasDescFile
 
 hasPackage
 
 host
 
 http
 
 importDescFile
 
 installed
 
 installPlans
 
 packageDir
 
 packageName
 
 packageVersion
 
 patchVersion
 
 perPlatform
 
 platform
 
 requires
 
 solo
 
 totalPlanCompleted
 
 totalPlanSize
 
 uncompressedArchive
 
 updated
 

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

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

Member Function Documentation

◆ checkStatus()

def checkStatus (   self)
Checks the current status of the desc file and the package
contents on disk. 

◆ downloadDescFile()

def downloadDescFile (   self,
  http 
)
Downloads the desc file for this particular package,
synchronously, and then reads it.  Returns true on success,
false on failure. 

◆ downloadDescFileGenerator()

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

◆ downloadPackage()

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

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

◆ getDownloadEffort()

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

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

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

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

◆ getUsage()

def getUsage (   self)
Returns the xusage element that is read from the usage.xml
file, or None if there is no usage.xml file. 

◆ hasCurrentDescFile()

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

◆ installPackage()

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

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

◆ setupFilenames()

def 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

◆ compressedArchive

compressedArchive

◆ currentStepEffort

currentStepEffort

◆ descFile

descFile

◆ descFileBasename

descFileBasename

◆ descFileDirname

descFileDirname

◆ diskSpace

diskSpace

◆ displayName

displayName

◆ downloadFactor

int downloadFactor = 1
static

◆ downloadProgress

downloadProgress

◆ extracts

extracts

◆ guiApp

guiApp

◆ hasDescFile

hasDescFile

◆ hasPackage

hasPackage

◆ host

host

◆ http

http

◆ importDescFile

importDescFile

◆ installed

installed

◆ installPlans

installPlans

◆ notify

notify = directNotify.newCategory("PackageInfo")
static

◆ packageDir

packageDir

◆ packageName

packageName

◆ packageVersion

packageVersion

◆ patchFactor

float patchFactor = 0.01
static

◆ patchVersion

patchVersion

◆ perPlatform

perPlatform

◆ platform

platform

◆ requires

requires

◆ restartDownload

int restartDownload = 3
static

◆ solo

solo

◆ stepComplete

int stepComplete = 1
static

◆ stepContinue

int stepContinue = 4
static

◆ stepFailed

int stepFailed = 2
static

◆ totalPlanCompleted

totalPlanCompleted

◆ totalPlanSize

totalPlanSize

◆ uncompressedArchive

uncompressedArchive

◆ uncompressFactor

float uncompressFactor = 0.01
static

◆ unpackFactor

float unpackFactor = 0.01
static

◆ updated

updated

◆ UsageBasename

string UsageBasename = 'usage.xml'
static