direct.p3d.PatchMaker
from direct.p3d.PatchMaker import PatchMaker
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 PatchMaker(installDir)[source]
Bases:
object
This class will operate on an existing package install directory, as generated by the Packager, and create patchfiles between versions as needed. It is also used at runtime, to apply the downloaded patches.
- class Package(packageDesc, patchMaker, xpackage=None)[source]
Bases:
object
This is a particular package. This contains all of the information needed to reconstruct the package’s desc file.
- class PackageVersion(packageName, platform, version, hostUrl, file)[source]
Bases:
object
A specific patch version of a package. This is not just the package’s “version” string; it also corresponds to the particular patch version, which increments independently of the “version”.
- applyPatch(self, origFile, patchFilename)[source]
Applies the named patch to the indicated original file, storing the results in a temporary file, and returns that temporary Filename. Returns None on failure.
- getFile(self)[source]
Returns the Filename of the archive file associated with this version. If the file doesn’t actually exist on disk, a temporary file will be created. Returns None if the file can’t be recreated.
- getPatchChain(self, startPv, alreadyVisited=[])[source]
Returns a list of patches that, when applied in sequence to the indicated PackageVersion object, will produce this PackageVersion object. Returns None if no chain can be found.
- getRecreateFilePlan(self, alreadyVisited=[])[source]
Returns the tuple (startFile, startPv, plan), describing how to recreate the archive file for this version. startFile and startPv is the Filename and packageVersion of the file to start with, and plan is a list of tuples (patchfile, pv), listing the patches to apply in sequence, and the packageVersion object associated with each patch. Returns (None, None, None) if there is no way to recreate this archive file.
- class Patchfile(package)[source]
Bases:
object
A single patchfile for a package.
- fromFile(self, packageDir, patchFilename, sourceFile, targetFile)[source]
Creates the data structures from an existing patchfile on disk.
- getSourceKey(self)[source]
Returns the key for locating the package that this patchfile can be applied to.
- buildPatch(self, v1, v2, package, patchFilename)[source]
Builds a patch from PackageVersion v1 to PackageVersion v2, and stores it in patchFilename.pz. Returns true on success, false on failure.
- buildPatchChains(self)[source]
Builds up the chains of PackageVersions and the patchfiles that connect them.
- buildPatchFile(self, origFilename, newFilename, patchFilename, printOrigName, printNewName)[source]
Creates a patch file from origFilename to newFilename, storing the result in patchFilename. Returns true on success, false on failure.
- buildPatches(self, packageNames=None)[source]
Makes the patches required in a particular directory structure on disk. If packageNames is None, this makes patches for all packages; otherwise, it should be a list of package name strings, limiting the set of packages that are processed.
- cleanup(self)[source]
Should be called on exit to remove temporary files and such created during processing.
- getPatchChainToCurrent(self, descFilename, fileSpec)[source]
Reads the package defined in the indicated desc file, and constructs a patch chain from the version represented by fileSpec to the current version of this package, if possible. Returns the patch chain if successful, or None otherwise.
- processAllPackages(self)[source]
Walks through the list of packages, and builds missing patches for each one.
- processSomePackages(self, packageNames)[source]
Builds missing patches only for the named packages.