Librepo handle class. Handle hold information about a repository and configuration for downloading from the repository.
Attributes:
See: LRO_UPDATE
See: LRO_URLS
See: LRO_MIRRORLIST
See: LRO_MIRRORLISTURL
See: LRO_METALINKURL
See: LRO_LOCAL
See: LRO_HTTPAUTH
See: LRO_USERPWD
See: LRO_PROXY
See: LRO_PROXYPORT
See: LRO_PROXYTYPE
See: LRO_PROXYAUTH
See: LRO_PROXYUSERPWD
See: LRO_PROGRESSCB
See: LRO_PROGRESSDATA
See: LRO_MAXSPEED
See: LRO_DESTDIR
See: LRO_REPOTYPE
See: LRO_CONNECTTIMEOUT
See: LRO_IGNOREMISSING
See: LRO_INTERRUPTIBLE
See: LRO_USERAGENT
See: LRO_FETCHMIRRORS
See: LRO_MAXMIRRORTRIES
See: LRO_VARSUB
See: LRO_FASTESTMIRROR
See: LRO_FASTESTMIRRORCB
See: LRO_LOWSPEEDTIME
See: LRO_LOWSPEEDLIMIT
See: LRO_GPGCHECK
See: LRO_CHECKSUM
See: LRO_RPMMDDLIST
See: LRO_YUMDLIST
See: LRO_RPMMDBLIST
See: LRO_YUMBLIST
See: LRO_HMFCB
See LRO_SSLCLIENTKEY
See LRO_SSLCACERT
See LRO_IPRESOLVE
See LRO_GNUPGHOMEDIR
See LRO_HTTPHEADER
See LRO_OFFLINE
See LRO_FTPUSEEPSV
This method is deprecated - Use download_packages() instead.
Download package from the repository specified in the Handle. If base_url is specified, urls and mirrors specified in the Handle are ignored.
Note: If resume is True and checksum_type and checksum are specified and downloaded package already exists, then checksum of the existing package is checked. If checksum matches, then no downloading is done and exception with LRE_ALREADYDOWNLOADED return code is raised.
Parameters: |
|
---|
Example:
h = librepo.Handle()
h.setopt(librepo.LRO_URLS, ["http://ftp.linux.ncsu.edu/pub/fedora/linux/releases/17/Everything/i386/os/"])
h.setopt(librepo.LRO_REPOTYPE, librepo.LR_YUMREPO)
h.download("Packages/s/sl-3.03-12.fc17.i686.rpm",
checksum="0ec8535d0fc00b497d8aef491c3f8b3955f2d84846325ee44851d9de8a36d12c",
checksum_type=librepo.CHECKSUM_SHA256)
Note
If checksum check is disabled in the current Handle, then checksum is NOT checked even if checksum and checksum_type params are specified!
Get information from Handle.
Parameters: | option – One of Handle info options |
---|---|
Returns: | Value for the specified option or None if the option is not set. |
Shortcut for creating a new PackageTarget objects. Targets created by this way have automatically setted handle to the current Handle object.
Parameters: | relative_url – Relative par of target (package) URL |
---|---|
Returns: | New PackageTarget |
Perform the specified action - download/locate a repository.
Parameters: | result – Result object or None |
---|---|
Returns: | Result object that was passed by result parameter or the new one if the parameter was not specified or was None. |
Set option to Handle directly.
Parameters: | option – One of: Handle options |
---|---|
Returns: | None |
Example:
# The command:
h.setopt(librepo.LRO_URLS, ["http://ftp.linux.ncsu.edu/pub/fedora/linux/releases/17/Everything/i386/os/"])
# is equivalent to:
h.urls(["http://ftp.linux.ncsu.edu/pub/fedora/linux/releases/17/Everything/i386/os/"])