There are a variety of subclasses of the RepoLib :ref`source-object` class which tailor its functionality toward dealing with specific types of parent sources. The default :ref`source-object` is best for dealing with native DEB822 sources on disk or as entered by user input.
- class repolib.DebLine(line)
A Source object class specifically intended to parse one-line debian repository list entries. This can be useful for both converting legacy sources to the new format, as well as a simple way for a user to add a new software source, since this format can be copy-pasted as a full line.
- line - The one-line source entry to parse into DEB822 format.
This is the one-line repository entry to operate on. Because this line contains the necessary information to fill in the Source object data completely, it is the only argument that the DebLine() accepts.
The line parameter is a string and must follow this format:
deb|deb-src ([options,...]) uri suite components
- class repolib.PPALine(line)
A Source object with convenience features for adding or removing PPA sources from launchpad.net. This class will exapand a
ppa:owner/sourceformat entry into a complete repository, and will download and save the signing key for the repository automatically (if an internet connection is available). It will also automatically name the entry based on data available on Launchpad.
A repository to add in the format:
This will be automatically expanded to the uri ``http://ppa.launchpad.net/owner-name/repository-name/ubuntu` and will be added with the current OS version codename serving as the “Suite:” and “main” as the only component.
Loads source information from launchpad about the ppa described by the ppa_line argument, or from the PPALine.ppa_line attribute if blank.
- ppa_line - The PPA to load from Launchpad.
PPAs are formatted as
ppa:onwer-name/repository-name. This argument if
present, must be a string matching this format.
repolib.ppa Module functions¶
- repolib.ppa.get_info_from_lp(owner_name, ppa)
Requests PPA information from Launchpad and returns a Dict containing the JSON response.
owner_name- The user or team name which hosts the PPA on launchpad.
ppa- The name of the ppa for which to fetch information.
Downloads the key with
fingerprintfrom keyserver.ubuntu.com and adds it to the system configuration.
fingerprint- The fingerprint of the key to download and fetch. This value is present in the JSON data returned by get-info-from-lp function.