rbtools.commands.install¶
Implementation of rbt install.
Classes
|
Install a dependency. |
- class rbtools.commands.install.Install(transport_cls=<class 'rbtools.api.transport.sync.SyncTransport'>, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin=<_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶
Bases:
Command
Install a dependency.
This allows RBTools to install external dependencies that may be needed for some features.
- description = 'Install an optional dependency.'[source]¶
A short description of the command, suitable for display in usage text.
- Type:
- args = '<package>'[source]¶
Usage text for what arguments the command takes.
Arguments for the command are anything passed in other than defined options (for example, revisions passed to rbt post).
- Type:
- option_list = [][source]¶
Command-line options for this command.
- Type:
list
ofOption
orOptionGroup
- main(package)[source]¶
Run the command.
- Parameters:
package (
unicode
) – The name of the package to install.- Raises:
rbtools.commands.CommandError – An error occurred during installation.
- check_download(url, zip_filename)[source]¶
Check to see if the file was successfully downloaded.
If the user has gpg installed on their system, use that to check that the package was signed. Otherwise, check the sha256sum.
- Parameters:
- Raises:
rbtools.commands.CommandError – The authenticity of the file could not be verified.
- unzip(zip_filename, package_dir)[source]¶
Unzip a .zip file.
This method will unpack the contents of a .zip file into a target directory. If that directory already exists, it will first be removed.
- Parameters:
- Raises:
rbtools.commands.CommandError – The file could not be unzipped.
- download_file(url, label=None)[source]¶
Download the given file.
This is intended to be used as a context manager, and the bound value will be the filename of the downloaded file.
- Parameters:
- Yields:
unicode
– The filename of the downloaded file.- Raises:
rbtools.commands.CommandError – An error occurred while downloading the file.