aptsources.sourceslist
— Provide an abstraction of the sources.list¶
Note
This part of the documentation is created automatically.
- class aptsources.sourceslist.Deb822SourceEntry(section: aptsources._deb822.Section | str | None, file: str, list: Optional[SourcesList] = None)¶
- property architectures¶
The list of architectures
- property comps¶
Components in the source
- property dist¶
Suites in the source
- merge(other: Union[SourceEntry, Deb822SourceEntry]) bool ¶
Merge the two entries if they are compatible.
- property suites¶
Suites in the source
- property type¶
The list of types
- property types¶
The list of types
- property uri¶
URIs in the source
- property uris¶
URIs in the source
- class aptsources.sourceslist.NullMatcher¶
a Matcher that does nothing
- match(s: Union[SourceEntry, Deb822SourceEntry, ExplodedDeb822SourceEntry]) bool ¶
- class aptsources.sourceslist.SourceEntry(line: str, file: str | None = None)¶
single sources.list entry
- static mysplit(line: str) list[str] ¶
a split() implementation that understands the sources.list format better and takes [] into account (for e.g. cdroms)
- class aptsources.sourceslist.SourceEntryMatcher(matcherPath: str)¶
matcher class to make a source entry look nice lots of predefined matchers to make it i18n/gettext friendly
- match(source: Union[SourceEntry, Deb822SourceEntry, ExplodedDeb822SourceEntry]) bool ¶
Add a matching template to the source
- class aptsources.sourceslist.SourcesList(withMatcher: bool = True, matcherPath: str = '/usr/share/python-apt/templates/', *, deb822: bool = False)¶
represents the full sources.list + sources.list.d file
- add(type: str, uri: str, dist: str, orig_comps: list[str], comment: str = '', pos: int = -1, file: str | None = None, architectures: Iterable[str] = [], parent: Optional[Union[SourceEntry, Deb822SourceEntry, ExplodedDeb822SourceEntry]] = None) Union[SourceEntry, Deb822SourceEntry, ExplodedDeb822SourceEntry] ¶
Add a new source to the sources.list. The method will search for existing matching repos and will try to reuse them as far as possible
- backup(backup_ext: str | None = None) str ¶
make a backup of the current source files, if no backup extension is given, the current date/time is used (and returned)
- check_for_relations(sources_list: Iterable[Union[SourceEntry, Deb822SourceEntry]]) tuple[list[Union[aptsources.sourceslist.SourceEntry, aptsources.sourceslist.Deb822SourceEntry]], dict[aptsources.distinfo.Template, list[Union[aptsources.sourceslist.SourceEntry, aptsources.sourceslist.Deb822SourceEntry]]]] ¶
get all parent and child channels in the sources list
- exploded_list() list[Union[aptsources.sourceslist.SourceEntry, aptsources.sourceslist.Deb822SourceEntry, aptsources.sourceslist.ExplodedDeb822SourceEntry]] ¶
Present an exploded view of the list where each entry corresponds exactly to a Release file.
A release file is uniquely identified by the triplet (type, uri, suite). Old style entries always referred to a single release file, but deb822 entries allow multiple values for each of those fields.
- index(entry: Union[SourceEntry, Deb822SourceEntry, ExplodedDeb822SourceEntry]) int ¶
- remove(source_entry: Union[SourceEntry, Deb822SourceEntry, ExplodedDeb822SourceEntry]) None ¶
remove the specified entry from the sources.list