Pro.Package
— API for handling packages¶
Overview¶
The Pro.Package
module contains the API for handling packages.
Packages can be managed in Cerbero Suite from the command line, using the Python SDK and from the UI. On Windows they can be installed from the shell context menu as well.
From the command line packages can be managed using the following syntax:
-pkg-create : Create Package
Syntax: -pkg-create input.zip output.cppkg
--name : The unique name of the package
--author : The author of the package
--publisher : The publisher of the package (optional)
--version : The version of the package. E.g.: --version "1.0.1"
--descr : A description of the package
--sign : The key to sign the package. E.g.: --sign private_key.pem
-pkg-install : Install Package
Syntax: -pkg-install package_to_install.cppkg
--force : Silently installs unverified packages
-pkg-uninstall : Uninstall Package
Syntax: -pkg-uninstall "Package Name"
-pkg-verify : Verify Package
Syntax: -pkg-verify package_to_verify.cppkg
-store : Cerbero Store
--install : The name of the package to install
--update : The name of the package to update
--update-all : Updates all installed packages
Similarly packages can be installed, uninstalled and verified in Cerbero Engine using the ‘ProManage.py’ script inside the local ‘python’ directory. E.g.:
python ProManage.py -pkg-install /path/to/package.cppkg
Every operation which can be performed from the command line can also be performed programmatically using the SDK.
Packages can be signed. When a package is unsigned or the signature cannot be trusted, it is shown by the installation dialog unless the --force
option is specified.
A key pair for signing and verifying packages can be generated as follows:
# create the private key
openssl genrsa -out private.pem 4096
# extract the public key
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
The public key must be added to the list of trusted signers. This can be achieved by placing the generated file with the name of the issuer in the ‘certs/pkg’ directory or by using the UI.
Since packages have their own format, they can be inspected using Cerbero Suite as any other supported file format. They can also be parsed programmatically using the Pro.Package.ProPackageObject
class.
Packages must have a unique name, an author, a version number of maximum 4 numeric parts and a description. Packages are created from Zip archives and they can operate in three different ways:
Relying on the automatic setup, without a setup script.
Relying on a setup script.
Relying on both the automatic setup and a setup script.
Out of the three ways, the first one is certainly the most intuitive: all the files in the Zip archive are installed following the same directory structure as in the archive.
This means that if the archive contains a file called:
plugins/python/CustomFolder/Code.py
It will be installed in the same directory under the user folder of Cerbero Suite or Cerbero Engine.
This is true for all files, except files in the ‘config’ directory. Those files are treated specially and their contents will be appended or removed from the configuration files of the user.
So, for instance, if the following configuration for an action must be installed:
[TestAction]
category = Test
label = Text label
file = TestCode.py
context = hex
It must only be stored in the archive under ‘config/actions.cfg’ and the automatic installation/uninstallation process takes care of the rest.
Sometimes, however, an automatic installation might not be enough to install an extension. In that case a setup script called ‘setup.py’ can be provided in the archive:
def install(sctx):
# custom operations
return True
def uninstall(sctx):
# custom operations
return True
However, installing everything manually might also not be ideal. In many cases the optimal solution would be an automatic installation with only a few custom operations:
def install(sctx):
# custom operations
return sctx.autoInstall()
def uninstall(sctx):
# custom operations
return sctx.autoUninstall()
To store files in the archive which should be ignored by the automatic setup, they must be placed under a folder called ‘setup’.
Alternatively, files can be individually installed and uninstalled relying on the automatic setup using the Pro.Package.ProPackageSetupContext.installFile()
and Pro.Package.ProPackageSetupContext.uninstallFile()
methods of the setup context, which is passed to the functions in the setup script.
Custom extraction operations can be performed using the Pro.Package.ProPackageSetupContext.extract()
method of the setup context.
An important thing to consider is that if the package is called ‘Test Package’, it will not make any difference if files are placed in the archive at the top level or under a root directory called ‘Test Package’.
For instance:
config/actions.cfg
setup.py
And:
Test Package/config/actions.cfg
Test Package/setup.py
Is considered to be the same. This way when creating the Zip archive, it can be created directly from a directory with the same name of the package.
Having a verified signature is not only good for security purposes, but also allows the package to show a custom icon in the installation dialog. The icon must be called ‘pkgicon.png’ and regardless of its size, it will be resized to a 48x48 icon when shown to the user.
What follows is an easy-to-adapt Python script to create packages using the command line of Cerbero Suite. It uses the ‘-c’ parameter, to avoid displaying message boxes.
import os, sys, shutil, subprocess
cerbero_app = r"[CERBERO_APP_PATH]"
private_key = r"[OPTIONAL_PRIVATE_KEY_PATH]"
pkg_dir = r"C:\MyPackage\TestPackage"
pkg_out = r"C:\MyPackage\TestPackage.cppkg"
pkg_name = "Test Package"
pkg_author = "Test Author"
pkg_version = "1.0.1"
pkg_descr = "Description."
shutil.make_archive(pkg_dir, "zip", pkg_dir)
args = [cerbero_app, "-c", "-pkg-create", pkg_dir + ".zip", pkg_out, "--name", pkg_name, "--author", pkg_author, "--version", pkg_version, "--descr", pkg_descr]
if private_key:
args.append("--sign")
args.append(private_key)
ret = subprocess.run(args).returncode
os.remove(pkg_dir + ".zip")
print("Package successfully created!" if ret == 0 else "Couldn't create package!")
sys.exit(ret)
Note
A publisher can be specified in case it differs from the author of the package. When a publisher is specified, the name of the signer of the package must match the name of the publisher.
Module API¶
Pro.Package module API.
Attributes:
The name of the package configuration file.
The file extension for packages.
The magic file signature for packages.
Author section id.
Data section id.
Description section id.
Maximum section id.
Minimum section id.
Name section id.
Publisher section id.
Signature section id.
Version section id.
Flag to force the installation of a package skipping signature verification.
Flag to silently install packages.
Flag to install and uninstall packages without success message boxes.
Extension package type.
Result value that indicates that changes have occurred during the invocation of a Store function.
Result value that indicates that an error has occurred during the invocation of a Store function.
Result value that indicates that no changes have occurred during the invocation of a Store function.
Classes:
This class contains the information to create a package programmatically.
This class contains information about an installed package.
List of
ProPackageInfo
elements.
ProPackageInfoListIt
(obj)Iterator class for
ProPackageInfoList
.This class is used to parse package files.
This class is passed to the
install
anduninstall
function in the ‘setup.py’ script of the package.Functions:
proGetInstalledPackages
([sort])Retrieves the list of installed packages.
proPackageAddConfiguration
(pkgname, …)Adds data to a configuration file.
proPackageCreate
(cd)Creates a package.
proPackageGetConfiguration
(pkgname, cfgfname)Retrieves the data of a package from a configuration file.
proPackageGetInfo
(name)Retrieves information about an installed package.
proPackageInstall
(path[, options])Installs a package.
proPackageIsInstalled
(name)Checks the presence of an installed package.
proPackageRemoveConfiguration
(pkgname, cfgfname)Automatically removes data related to a package from a configuration file.
proPackageUninstall
(name[, options])Uninstalls a package.
proPackageVerify
(path[, options])Verifies the signature of a package.
proStoreInstall
(out, name[, w, options])Installs or updates a package from Cerbero Store.
proStoreUpdate
(out, name[, w, options])Updates a package installed from Cerbero Store.
proStoreUpdateAll
(out[, w, options])Updates all packages installed from Cerbero Store.
- PRO_PACKAGES_CFG_FILE_NAME: Final[str]¶
The name of the package configuration file.
- PRO_PACKAGE_EXT: Final[str]¶
The file extension for packages.
- PRO_PACKAGE_FILE_SIGNATURE: Final[str]¶
The magic file signature for packages.
- class ProPackageCreationData¶
This class contains the information to create a package programmatically.
See also
proPackageCreate()
.Methods:
addInputFile
(path)Adds an input file.
setAuthor
(author)Sets the author of the package.
setDescription
(descr)Sets the description of the package.
setName
(name)Sets the name of the package.
setOutputFile
(path)Sets the output file name of the package.
setPublisher
(publisher)Sets the publisher of the package.
setSigningKey
(path)Sets the file name of the key used to sign the package.
setVersion
(version)Sets the version of the package.
- addInputFile(path: str) → None¶
Adds an input file.
Important
This must be the input Zip archive.
- Parameters
path (str) – The input file.
See also
setOutputFile()
.
- setAuthor(author: str) → None¶
Sets the author of the package.
- Parameters
author (str) – The author of the package.
See also
setPublisher()
.
- setDescription(descr: str) → None¶
Sets the description of the package.
- Parameters
descr (str) – The description of the package.
- setName(name: str) → None¶
Sets the name of the package.
- Parameters
name (str) – The name of the package.
- setOutputFile(path: str) → None¶
Sets the output file name of the package.
- Parameters
path (str) – The output file name of the package.
See also
addInputFile()
.
- setPublisher(publisher: str) → None¶
Sets the publisher of the package.
- Parameters
publisher (str) – The publisher of the package.
See also
setAuthor()
.
- setSigningKey(path: str) → None¶
Sets the file name of the key used to sign the package.
- Parameters
path (str) – The file name of the signing key.
- setVersion(version: str) → None¶
Sets the version of the package.
The version string can have a maximum of 4 numeric parts separated by dots.
- Parameters
version (str) – The version of the package.
- class ProPackageInfo¶
This class contains information about an installed package.
See also
proGetInstalledPackages()
andproPackageGetInfo()
.Attributes:
The author of the package.
The description of the package.
The name of the package.
The publisher of the package.
The version of the package.
- author¶
The author of the package.
- descr¶
The description of the package.
- name¶
The name of the package.
- publisher¶
The publisher of the package.
- version¶
The version of the package.
- class ProPackageInfoList¶
List of
ProPackageInfo
elements.Methods:
append
(value)Inserts
value
at the end of the list.
at
(i)Returns the item at index position
i
in the list.
clear
()Removes all items from the list.
contains
(value)Checks the presence of an element in the list.
count
(value)Returns the number of occurrences of
value
in the list.
indexOf
(value[, start])Searches for an element in the list.
insert
(i, value)Inserts
value
at index positioni
in the list.
isEmpty
()Checks whether the list is empty.
iterator
()Creates an iterator for the list.
removeAll
(value)Removes all occurrences of
value
in the list and returns the number of entries removed.
removeAt
(i)Removes the item at index position
i
.
reserve
(alloc)Reserve space for
alloc
elements.
size
()Returns the number of items in the list.
takeAt
(i)Removes the item at index position
i
and returns it.
- append(value: Pro.Package.ProPackageInfo) → None¶
Inserts
value
at the end of the list.
- Parameters
value (ProPackageInfo) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.Package.ProPackageInfo¶
Returns the item at index position
i
in the list.i
must be a valid index position in the list (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all items from the list.
- contains(value: Pro.Package.ProPackageInfo) → bool¶
Checks the presence of an element in the list.
- Parameters
value (ProPackageInfo) – The value to check for.
- Returns
Returns
True
if the list contains an occurrence ofvalue
; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.Package.ProPackageInfo) → int¶
Returns the number of occurrences of
value
in the list.
- Parameters
value (ProPackageInfo) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.Package.ProPackageInfo, start: int = 0) → int¶
Searches for an element in the list.
- Parameters
value (ProPackageInfo) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the list. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.Package.ProPackageInfo) → None¶
Inserts
value
at index positioni
in the list. Ifi
is0
, the value is prepended to the list. Ifi
issize()
, the value is appended to the list.
- Parameters
i (int) – The position at which to add the value.
value (ProPackageInfo) – The value to add.
See also
append()
andremoveAt()
.
- isEmpty() → bool¶
Checks whether the list is empty.
- Returns
Returns
True
if the list contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.Package.ProPackageInfoListIt¶
Creates an iterator for the list.
- Returns
Returns the iterator.
- Return type
- removeAll(value: Pro.Package.ProPackageInfo) → int¶
Removes all occurrences of
value
in the list and returns the number of entries removed.
- Parameters
value (ProPackageInfo) – The value to remove from the list.
- Returns
Returns the number of entries removed.
- Return type
int
See also
removeAt()
.
- removeAt(i: int) → None¶
Removes the item at index position
i
.i
must be a valid index position in the list (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the item to remove.
See also
removeAll()
.
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the list.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- takeAt(i: int) → Pro.Package.ProPackageInfo¶
Removes the item at index position
i
and returns it.i
must be a valid index position in the list (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to remove from the list.
- Returns
Returns the removed element. If you don’t use the return value,
removeAt()
is more efficient.- Return type
See also
removeAt()
.
- class ProPackageInfoListIt(obj: Pro.Package.ProPackageInfoList)¶
Iterator class for
ProPackageInfoList
.
- Parameters
obj (ProPackageInfoList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.Package.ProPackageInfo¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.Package.ProPackageInfo¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- class ProPackageObject¶
Bases:
Pro.Core.CFFObject
This class is used to parse package files.
Important
ParseSections()
must be called directly afterPro.Core.CFFObject.Load()
to initialize the class.See also
ParseSections()
.Methods:
Returns the author of the package.
Returns the description of the package.
GetInfo
()Returns information about the package.
GetName
()Returns the name of the package.
Returns the package type.
Returns the version of the package.
Returns the publisher of the package.
GetSectionName
(id)Retrieves the name of a section from its id.
GetSectionRange
(id)Retrieves the data range of a section from its id.
Retrieves the signer of the package.
Returns the version of the package.
Returns
True
if the package has a publisher; otherwise returnsFalse
.
HasSection
(id)Checks if a section is present from its id.
Returns
True
if the package is signed; otherwise returnsFalse
.
Header
()Returns the header structure of the package.
OutputInfo
(out)Outputs information about the package to a text stream.
Parses the sections of the package.
Verifies the signature of the package.
Attributes:
Signature error verification result.
Invalid signature verification result.
No signature verification result.
Untrusted signature verification result.
Valid signature verification result.
- GetAuthor() → str¶
- Returns
Returns the author of the package.
- Return type
str
- GetDescription() → str¶
- Returns
Returns the description of the package.
- Return type
str
- GetInfo() → str¶
- Returns
Returns information about the package.
- Return type
str
See also
OutputInfo()
.
- GetName() → str¶
- Returns
Returns the name of the package.
- Return type
str
- GetPackageType() → int¶
- Returns
Returns the package type.
- Return type
int
See also
ProPackageType_Extension
.
- GetPackageVersion() → int¶
- Returns
Returns the version of the package.
- Return type
int
- GetPublisher() → str¶
- Returns
Returns the publisher of the package.
- Return type
str
See also
HasPublisher()
.
- GetSectionName(id: int) → str¶
Retrieves the name of a section from its id.
- Parameters
id (int) – The id of the section (e.g.,
ProPackageSectionId_Name
).- Returns
Returns the name of the section.
- Return type
str
- GetSectionRange(id: int) → Pro.Core.NTOffsetRange¶
Retrieves the data range of a section from its id.
- Parameters
id (int) – The id of the section (e.g.,
ProPackageSectionId_Name
).- Returns
Returns a valid data range if the section is present; otherwise returns an invalid data range (
Pro.Core.NTOffsetRange.offset
equalsPro.Core.INVALID_STREAM_OFFSET
).- Return type
See also
HasSection()
.
- GetSigner() → str¶
Retrieves the signer of the package.
The signer of the package is the publisher if available; otherwise it’s the author.
- Returns
Returns the signer of the package.
- Return type
str
See also
HasSignature()
andVerifySignature()
.
- GetVersion() → str¶
- Returns
Returns the version of the package.
- Return type
str
- HasPublisher() → bool¶
- Returns
Returns
True
if the package has a publisher; otherwise returnsFalse
.- Return type
bool
See also
GetPublisher()
.
- HasSection(id: int) → bool¶
Checks if a section is present from its id.
- Parameters
id (int) – The id of the section (e.g.,
ProPackageSectionId_Name
).- Returns
Returns
True
if the section is present; otherwise returnsFalse
.- Return type
bool
See also
GetSectionRange()
.
- HasSignature() → bool¶
- Returns
Returns
True
if the package is signed; otherwise returnsFalse
.- Return type
bool
See also
VerifySignature()
andGetSigner()
.
- Header() → Pro.Core.CFFStruct¶
- Returns
Returns the header structure of the package.
- Return type
- OutputInfo(out: Pro.Core.NTTextStream) → None¶
Outputs information about the package to a text stream.
- Parameters
out (NTTextStream) – The output text stream.
See also
GetInfo()
.
- ParseSections() → bool¶
Parses the sections of the package.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
- Signature_Error: Final[int]¶
Signature error verification result.
See also
VerifySignature()
.
- Signature_Invalid: Final[int]¶
Invalid signature verification result.
See also
VerifySignature()
.
- Signature_None: Final[int]¶
No signature verification result.
See also
VerifySignature()
.
- Signature_Untrusted: Final[int]¶
Untrusted signature verification result.
See also
VerifySignature()
.
- Signature_Valid: Final[int]¶
Valid signature verification result.
See also
VerifySignature()
.
- VerifySignature() → int¶
Verifies the signature of the package.
- Returns
Returns a verification result (e.g.,
Signature_Valid
).- Return type
int
See also
HasSignature()
andGetSigner()
.
- ProPackageSectionId_Author: Final[int]¶
Author section id.
See also
ProPackageObject.GetAuthor()
,ProPackageObject.HasSection()
andProPackageObject.GetSectionRange()
.
- ProPackageSectionId_Data: Final[int]¶
Data section id.
See also
ProPackageObject.HasSection()
andProPackageObject.GetSectionRange()
.
- ProPackageSectionId_Descr: Final[int]¶
Description section id.
See also
ProPackageObject.GetDescription()
,ProPackageObject.HasSection()
andProPackageObject.GetSectionRange()
.
- ProPackageSectionId_Max: Final[int]¶
Maximum section id.
- ProPackageSectionId_Min: Final[int]¶
Minimum section id.
- ProPackageSectionId_Name: Final[int]¶
Name section id.
See also
ProPackageObject.GetName()
,ProPackageObject.HasSection()
andProPackageObject.GetSectionRange()
.
- ProPackageSectionId_Publisher: Final[int]¶
Publisher section id.
See also
ProPackageObject.GetPublisher()
,ProPackageObject.HasSection()
andProPackageObject.GetSectionRange()
.
- ProPackageSectionId_Signature: Final[int]¶
Signature section id.
See also
ProPackageObject.VerifySignature()
,ProPackageObject.HasSignature()
andProPackageObject.GetSigner()
.
- ProPackageSectionId_Version: Final[int]¶
Version section id.
See also
ProPackageObject.GetVersion()
,ProPackageObject.HasSection()
andProPackageObject.GetSectionRange()
.
- class ProPackageSetupContext¶
This class is passed to the
install
anduninstall
function in the ‘setup.py’ script of the package.Methods:
PDBSymbolsDir
([opt])Retrieves the installation PDB symbols directory.
addConfiguration
(cfgfname, cfgdata)Adds data to a configuration file.
Automatically installs the package files.
Automatically uninstalls the package files.
carbonThemesDir
([opt])Retrieves the installation carbon themes directory.
configDir
([opt])Retrieves the installation configuration directory.
contains
(src)Checks the presence of a file in the package.
extract
(src[, dst])Extracts a file from the package either to a destination on disk or to a
Pro.Core.NTContainer
.
headersDir
([opt])Retrieves the installation headers directory.
installFile
(src)Automatically installs a single.
mediaDir
([opt])Retrieves the installation media directory.
packageCertificatesDir
([opt])Retrieves the installation package certificates directory.
Returns the file name of the package.
Returns the name of the package.
Returns the package object.
Returns the signature verification status of the package (e.g.,
ProPackageObject.Signature_Valid
).
packagesDir
([opt])Retrieves the installation package directory.
pluginsDir
([opt])Retrieves the installation plugins directory.
pythonPluginsDir
([opt])Retrieves the installation Python plugins directory.
removeConfiguration
(cfgfname)Automatically removes data related to the current package from a configuration file.
rootDir
([opt])Retrieves the installation root directory.
themesDir
([opt])Retrieves the installation themes directory.
uninstallFile
(src)Automatically uninstalls a single.
- PDBSymbolsDir(opt: int = ToolDir_None) → str¶
Retrieves the installation PDB symbols directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- addConfiguration(cfgfname: str, cfgdata: Union[bytes, str]) → bool¶
Adds data to a configuration file.
- Parameters
cfgfname (str) – The name of the configuration file.
cfgdata (Union[bytes, str]) – The data to add.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
removeConfiguration()
.
- autoInstall() → bool¶
Automatically installs the package files.
Note
This method ignores the files contained in the ‘setup’ folder.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
autoUninstall()
andinstallFile()
.
- autoUninstall() → bool¶
Automatically uninstalls the package files.
Note
This method ignores the files contained in the ‘setup’ folder.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
autoInstall()
anduninstallFile()
.
- carbonThemesDir(opt: int = ToolDir_None) → str¶
Retrieves the installation carbon themes directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- configDir(opt: int = ToolDir_None) → str¶
Retrieves the installation configuration directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- contains(src: str) → bool¶
Checks the presence of a file in the package.
- Parameters
src (str) – The name of the file.
- Returns
Returns
True
if the file is present in the package; otherwise returnsFalse
.- Return type
bool
See also
extract()
.
- extract(src: str, dst: Optional[str] = None) → Union[Pro.Core.NTContainer, bool]¶
Extracts a file from the package either to a destination on disk or to a
Pro.Core.NTContainer
.
- Parameters
src (str) – The name of the file to extract.
dst (Optional[str]) – The optional output file name.
- Returns
Returns an
Pro.Core.NTContainer
instance if an output file name wasn’t specified; otherwise returns a boolean value.- Return type
Union[NTContainer, bool]
See also
contains()
.
- headersDir(opt: int = ToolDir_None) → str¶
Retrieves the installation headers directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- installFile(src: str) → bool¶
Automatically installs a single.
- Parameters
src (str) – The name of the file to install.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
uninstallFile()
andautoInstall()
.
- mediaDir(opt: int = ToolDir_None) → str¶
Retrieves the installation media directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- packageCertificatesDir(opt: int = ToolDir_None) → str¶
Retrieves the installation package certificates directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- packageFileName() → str¶
- Returns
Returns the file name of the package.
- Return type
str
- packageName() → str¶
- Returns
Returns the name of the package.
- Return type
str
- packageObject() → Pro.Package.ProPackageObject¶
- Returns
Returns the package object.
- Return type
See also
ProPackageObject
.
- packageVerificationStatus() → int¶
- Returns
Returns the signature verification status of the package (e.g.,
ProPackageObject.Signature_Valid
).- Return type
int
See also
ProPackageObject.Signature_Valid
.
- packagesDir(opt: int = ToolDir_None) → str¶
Retrieves the installation package directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- pluginsDir(opt: int = ToolDir_None) → str¶
Retrieves the installation plugins directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- pythonPluginsDir(opt: int = ToolDir_None) → str¶
Retrieves the installation Python plugins directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- removeConfiguration(cfgfname: str) → bool¶
Automatically removes data related to the current package from a configuration file.
- Parameters
cfgfname (str) – The name of the configuration file.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
addConfiguration()
.
- rootDir(opt: int = ToolDir_None) → str¶
Retrieves the installation root directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- themesDir(opt: int = ToolDir_None) → str¶
Retrieves the installation themes directory.
- Parameters
opt (int) – By default
Pro.Core.ToolDir_None
.- Returns
Returns the directory if successful; otherwise returns an empty string.
- Return type
str
See also
ToolDir_CreateIfMissing
.
- uninstallFile(src: str) → bool¶
Automatically uninstalls a single.
- Parameters
src (str) – The name of the file to uninstall.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
installFile()
andautoUninstall()
.
- ProPackageSetupOption_Force: Final[int]¶
Flag to force the installation of a package skipping signature verification.
See also
proPackageInstall()
.
- ProPackageSetupOption_Silent: Final[int]¶
Flag to silently install packages.
See also
proPackageInstall()
.
- ProPackageSetupOption_SkipSuccessMessage: Final[int]¶
Flag to install and uninstall packages without success message boxes.
See also
proPackageInstall()
andproPackageUninstall()
.
- ProPackageType_Extension: Final[int]¶
Extension package type.
See also .
- ProStore_Changes: Final[int]¶
Result value that indicates that changes have occurred during the invocation of a Store function.
See also
proStoreInstall()
,proStoreUpdate()
andproStoreUpdateAll()
.
- ProStore_Error: Final[int]¶
Result value that indicates that an error has occurred during the invocation of a Store function.
See also
proStoreInstall()
,proStoreUpdate()
andproStoreUpdateAll()
.
- ProStore_NoChanges: Final[int]¶
Result value that indicates that no changes have occurred during the invocation of a Store function.
See also
proStoreInstall()
,proStoreUpdate()
andproStoreUpdateAll()
.
- proGetInstalledPackages(sort: bool = True) → Pro.Package.ProPackageInfoList¶
Retrieves the list of installed packages.
- Parameters
sort (bool) – If
True
, the returned is sorted by package name.- Returns
Returns the list of installed packages.
- Return type
See also
ProPackageInfo
.See also
proPackageGetInfo()
andproPackageIsInstalled()
.
- proPackageAddConfiguration(pkgname: str, cfgfname: str, cfgdata: Union[bytes, str]) → bool¶
Adds data to a configuration file.
- Parameters
pkgname (str) – The name of the package.
cfgfname (str) – The name of the configuration file.
cfgdata (Union[bytes, str]) – The data to add.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.3.1 and Cerbero Engine 4.3.1.
See also
proPackageGetConfiguration()
andproPackageRemoveConfiguration()
.
- proPackageCreate(cd: Pro.Package.ProPackageCreationData) → bool¶
Creates a package.
- Parameters
cd (ProPackageCreationData) – The creation data.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
ProPackageCreationData
.
- proPackageGetConfiguration(pkgname: str, cfgfname: str) → str¶
Retrieves the data of a package from a configuration file.
- Parameters
pkgname (str) – The name of the package.
cfgfname (str) – The name of the configuration file.
- Returns
Returns the configuration if successful; otherwise returns an empty string.
- Return type
str
Available since Cerbero Suite 7.3.1 and Cerbero Engine 4.3.1.
See also
proPackageAddConfiguration()
andproPackageRemoveConfiguration()
.
- proPackageGetInfo(name: str) → Pro.Package.ProPackageInfo¶
Retrieves information about an installed package.
- Parameters
name (str) – The name of the package.
- Returns
Returns the package information if successful; otherwise returns an empty
ProPackageInfo
instance.- Return type
See also
proGetInstalledPackages()
andproPackageIsInstalled()
.
- proPackageInstall(path: str, options: int = 0) → bool¶
Installs a package.
- Parameters
path (str) – The file name of the package.
options (int) – The installation options (e.g.,
ProPackageSetupOption_Force
).- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
proPackageUninstall()
,proPackageIsInstalled()
,ProPackageSetupOption_Force
,ProPackageSetupOption_Silent
andProPackageSetupOption_SkipSuccessMessage
.
- proPackageIsInstalled(name: str) → bool¶
Checks the presence of an installed package.
- Parameters
name (str) – The name of the package.
- Returns
Returns
True
if the package is installed; otherwise returnsFalse
.- Return type
bool
See also
proPackageGetInfo()
andproGetInstalledPackages()
.
- proPackageRemoveConfiguration(pkgname: str, cfgfname: str) → bool¶
Automatically removes data related to a package from a configuration file.
- Parameters
pkgname (str) – The name of the package.
cfgfname (str) – The name of the configuration file.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.3.1 and Cerbero Engine 4.3.1.
See also
proPackageAddConfiguration()
andproPackageGetConfiguration()
.
- proPackageUninstall(name: str, options: int = 0) → bool¶
Uninstalls a package.
- Parameters
name (str) – The name of the package.
options (int) – The uninstallation options (e.g.,
ProPackageSetupOption_SkipSuccessMessage
).- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
proPackageInstall()
,proPackageIsInstalled()
,ProPackageSetupOption_Silent
andProPackageSetupOption_SkipSuccessMessage
.
- proPackageVerify(path: str, options: int = 0) → bool¶
Verifies the signature of a package.
- Parameters
path (str) – The file name of the package.
options (int) – The verification options (e.g.,
ProPackageSetupOption_SkipSuccessMessage
).- Returns
Returns
True
if the signature of the package is valid; otherwise returnsFalse
.- Return type
bool
See also
ProPackageObject.VerifySignature()
andProPackageSetupOption_SkipSuccessMessage
.
- proStoreInstall(out: Pro.Core.NTTextStream, name: str, w: Optional[Pro.Core.NTIWait] = None, options: int = 0) → int¶
Installs or updates a package from Cerbero Store.
- Parameters
out (NTTextStream) – The output text stream.
name (str) – The name of the package to install.
w (NTIWait) – The optional wait object for the operation.
options (int) – This argument is reserved for future use.
- Returns
Returns a Store value result (e.g.,
ProStore_Changes
).- Return type
int
See also
proStoreUpdate()
,proStoreUpdateAll()
,ProStore_Changes
,ProStore_NoChanges
andProStore_Error
.
- proStoreUpdate(out: Pro.Core.NTTextStream, name: str, w: Optional[Pro.Core.NTIWait] = None, options: int = 0) → int¶
Updates a package installed from Cerbero Store.
- Parameters
out (NTTextStream) – The output text stream.
name (str) – The name of the package to update.
w (NTIWait) – The optional wait object for the operation.
options (int) – This argument is reserved for future use.
- Returns
Returns a Store value result (e.g.,
ProStore_Changes
).- Return type
int
See also
proStoreInstall()
,proStoreUpdateAll()
,ProStore_Changes
,ProStore_NoChanges
andProStore_Error
.
- proStoreUpdateAll(out: Pro.Core.NTTextStream, w: Optional[Pro.Core.NTIWait] = None, options: int = 0) → int¶
Updates all packages installed from Cerbero Store.
- Parameters
out (NTTextStream) – The output text stream.
w (NTIWait) – The optional wait object for the operation.
options (int) – This argument is reserved for future use.
- Returns
Returns a Store value result (e.g.,
ProStore_Changes
).- Return type
int
See also
proStoreUpdate()
,proStoreInstall()
,ProStore_Changes
,ProStore_NoChanges
andProStore_Error
.