rbtools.commands.install¶
Implementation of rbt install.
Classes
|
Install a dependency. |
- class rbtools.commands.install.Install(transport_cls: Type[Transport] = <class 'rbtools.api.transport.sync.SyncTransport'>, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr: TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin: TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶
Bases:
BaseCommand
Install a dependency.
This allows RBTools to install external dependencies that may be needed for some features.
- description: str = 'Install an optional dependency.'[source]¶
A short description of the command, suitable for display in usage text.
- Type:
- args: str = '<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: List[Union[Option, OptionGroup]] = [][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.
- 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.
- 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.