summaryrefslogtreecommitdiff
path: root/doc/source/apt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/apt')
-rw-r--r--doc/source/apt/cache.rst78
-rw-r--r--doc/source/apt/cdrom.rst7
-rw-r--r--doc/source/apt/debfile.rst39
-rw-r--r--doc/source/apt/gtk.widgets.rst29
-rw-r--r--doc/source/apt/index.rst58
-rw-r--r--doc/source/apt/package.rst101
-rw-r--r--doc/source/apt/progress.rst37
7 files changed, 349 insertions, 0 deletions
diff --git a/doc/source/apt/cache.rst b/doc/source/apt/cache.rst
new file mode 100644
index 00000000..d96cba97
--- /dev/null
+++ b/doc/source/apt/cache.rst
@@ -0,0 +1,78 @@
+:mod:`apt.cache` --- The Cache class
+=====================================
+.. automodule:: apt.cache
+
+The Cache class
+---------------
+
+.. autoclass:: Cache
+ :members:
+ :undoc-members:
+
+ .. describe:: cache[pkgname]
+
+ Return a :class:`Package()` for the package with the name *pkgname*.
+
+Example
+^^^^^^^
+
+The following example shows how to load the cache, update it, and upgrade
+all the packages on the system::
+
+ import apt
+ import apt.progress
+
+ # First of all, open the cache
+ cache = apt.Cache()
+ # Now, lets update the package list
+ cache.update()
+ # We need to re-open the cache because it needs to read the package list
+ cache.open(None)
+ # Now we can do the same as 'apt-get upgrade' does
+ cache.upgrade()
+ # or we can play 'apt-get dist-upgrade'
+ cache.upgrade(True)
+ # Q: Why does nothing happen?
+ # A: You forgot to call commit()!
+ cache.commit(apt.progress.TextFetchProgress(),
+ apt.progress.InstallProgress())
+
+
+
+Working with Filters
+--------------------
+.. autoclass:: Filter
+ :members:
+ :inherited-members:
+ :undoc-members:
+
+.. autoclass:: MarkedChangesFilter
+ :members:
+ :inherited-members:
+ :undoc-members:
+
+.. autoclass:: FilteredCache
+ :members:
+ :inherited-members:
+ :undoc-members:
+
+
+Example
+^^^^^^^
+
+This is an example for a filtered cache, which only allows access to the
+packages whose state has been changed, eg. packages marked for installation::
+
+ >>> from apt.cache import FilteredCache, Cache, MarkedChangesFilter
+ >>> cache = apt.Cache()
+ >>> changed = apt.FilteredCache(cache)
+ >>> changed.setFilter(MarkedChangesFilter())
+ >>> print len(changed) == len(cache.GetChanges()) # Both need to have same length
+ True
+
+
+Exceptions
+----------
+.. autoexception:: FetchCancelledException
+.. autoexception:: FetchFailedException
+.. autoexception:: LockFailedException
diff --git a/doc/source/apt/cdrom.rst b/doc/source/apt/cdrom.rst
new file mode 100644
index 00000000..56381f14
--- /dev/null
+++ b/doc/source/apt/cdrom.rst
@@ -0,0 +1,7 @@
+:mod:`apt.cdrom` - Functionality like in apt-cdrom
+====================================================
+.. automodule:: apt.cdrom
+ :members:
+
+
+
diff --git a/doc/source/apt/debfile.rst b/doc/source/apt/debfile.rst
new file mode 100644
index 00000000..7133b5a8
--- /dev/null
+++ b/doc/source/apt/debfile.rst
@@ -0,0 +1,39 @@
+:mod:`apt.debfile` --- Classes related to debian package files
+==============================================================
+The :mod:`apt.debfile` provides classes to work with locally available
+debian packages, or source packages.
+
+.. module:: apt.debfile
+
+Binary packages
+----------------
+.. autoclass:: DebPackage
+ :members:
+ :inherited-members:
+ :undoc-members:
+
+ The :class:`DebPackage` class is a class for working with '.deb' files,
+ also known as Debian packages.
+
+ It provides methods and attributes to get a list of the files in the
+ package, to install the package and much more.
+
+ If you specify *cache* it has to point to an :class:`apt.cache.Cache()`
+ object.
+
+ .. versionchanged:: 0.7.9
+ Introduce all new methods (everything except for :meth:`open()` and
+ :attr:`filelist`)
+
+
+Source packages
+----------------
+.. autoclass:: DscSrcPackage
+ :members:
+ :inherited-members:
+ :undoc-members:
+
+ Provide functionality to work with locally available source packages,
+ especially with their '.dsc' file.
+
+ .. versionadded:: 0.7.9
diff --git a/doc/source/apt/gtk.widgets.rst b/doc/source/apt/gtk.widgets.rst
new file mode 100644
index 00000000..9fa84ead
--- /dev/null
+++ b/doc/source/apt/gtk.widgets.rst
@@ -0,0 +1,29 @@
+:mod:`apt.gtk.widgets` --- GTK widgets
+======================================
+.. automodule:: apt.gtk.widgets
+
+
+GObject progress classes
+-------------------------
+
+.. autoclass:: GDpkgInstallProgress
+ :members:
+
+.. autoclass:: GFetchProgress
+ :members:
+
+.. autoclass:: GInstallProgress
+ :members:
+
+.. autoclass:: GOpProgress
+ :members:
+
+GTK+ Class
+----------
+.. autoclass:: GtkAptProgress
+ :members:
+
+
+Example
+-------
+.. literalinclude:: ../examples/apt-gtk.py
diff --git a/doc/source/apt/index.rst b/doc/source/apt/index.rst
new file mode 100644
index 00000000..5047a0fd
--- /dev/null
+++ b/doc/source/apt/index.rst
@@ -0,0 +1,58 @@
+:mod:`apt` --- Highlevel apt package
+=====================================
+The highlevel apt package provides a lot of functionality, all
+with an easy-to-use interface.
+
+.. warning::
+ The API of this package is not considered stable. Evenmore, it is considered
+ to change the naming conventions in future to lowercase_with_underscores.
+
+ In case this happens, the API will still be kept compatible, with the old
+ functions provided as deprecated ones.
+
+.. automodule:: apt
+ :members:
+
+
+
+
+.. toctree::
+ :maxdepth: 2
+ :glob:
+
+ *
+
+
+Classes exported in apt
+------------------------
+These classes are defined in the submodules, but are also exported directly
+in the package.
+
+.. class:: Cache
+
+ Please see :class:`apt.cache.Cache` for documentation.
+
+.. class:: Cdrom
+
+ Please see :class:`apt.cdrom.Cdrom` for documentation.
+
+.. class:: CdromProgress
+
+ Please see :class:`apt.progress.CdromProgress` for documentation.
+
+.. class:: FetchProgress
+
+ Please see :class:`apt.progress.FetchProgress` for documentation.
+
+.. class:: InstallProgress
+
+ Please see :class:`apt.progress.InstallProgress` for documentation.
+
+.. class:: OpProgress
+
+ Please see :class:`apt.progress.OpProgress` for documentation.
+
+.. class:: Package
+
+ Please see :class:`apt.package.Package` for documentation.
+
diff --git a/doc/source/apt/package.rst b/doc/source/apt/package.rst
new file mode 100644
index 00000000..1bd032ab
--- /dev/null
+++ b/doc/source/apt/package.rst
@@ -0,0 +1,101 @@
+:mod:`apt.package` --- Classes for package handling
+====================================================
+
+
+.. automodule:: apt.package
+
+
+The Package class
+-----------------
+.. autoclass:: Package
+ :members:
+
+
+Dependency Information
+----------------------
+.. class:: BaseDependency
+
+ The :class:`BaseDependency` class defines various attributes for accessing
+ the parts of a dependency. The attributes are as follows:
+
+ .. attribute:: name
+
+ The name of the dependency
+
+ .. attribute:: relation
+
+ The relation (>>,>=,==,<<,<=,)
+
+ .. attribute:: version
+
+ The version or None.
+
+ .. attribute:: preDepend
+
+ Boolean value whether this is a pre-dependency.
+
+.. class:: Dependency
+
+ The dependency class represents a Or-Group of dependencies. It provides
+ an attribute to access the :class:`BaseDependency` object for the available
+ choices.
+
+ .. attribute:: or_dependencies
+
+ A list of :class:`BaseDependency` objects which could satisfy the
+ requirement of the Or-Group.
+
+
+Origin Information
+-------------------
+.. class:: Origin
+
+ The :class:`Origin` class provides access to the origin of the package.
+ It allows you to check the component, archive, the hostname, and even if
+ this package can be trusted.
+
+ .. attribute:: archive
+
+ The archive (eg. unstable)
+
+ .. attribute:: component
+
+ The component (eg. main)
+
+ .. attribute:: label
+
+ The Label, as set in the Release file
+
+ .. attribute:: origin
+
+ The Origin, as set in the Release file
+
+ .. attribute:: site
+
+ The hostname of the site.
+
+ .. attribute:: trusted
+
+ Boolean value whether this is trustworthy. An origin can be trusted, if
+ it provides a GPG-signed Release file and the GPG-key used is in the
+ keyring used by apt (see apt-key).
+
+Examples
+---------
+.. code-block:: python
+
+ import apt
+
+ cache = apt.Cache()
+ pkg = cache['python-apt'] # Access the Package object for python-apt
+ print 'python-apt is trusted:', pkg.candidateOrigin.trusted
+
+ # Mark python-apt for install
+ pkg.markInstall()
+
+ print 'python-apt is marked for install:', pkg.markedInstall
+
+ print 'python-apt is', pkg.summary #Python interface to libapt-pkg
+
+ # Now, really install it
+ cache.commit()
diff --git a/doc/source/apt/progress.rst b/doc/source/apt/progress.rst
new file mode 100644
index 00000000..8989aa27
--- /dev/null
+++ b/doc/source/apt/progress.rst
@@ -0,0 +1,37 @@
+:mod:`apt.progress` --- Classes for progress reporting
+======================================================
+.. automodule:: apt.progress
+
+.. warning::
+
+ This class is currently under re-organisation. Therefore, the API may
+ change soon. The old names will still be kept until it is safe to remove
+ them.
+
+
+
+Classes without output
+----------------------
+.. autoclass:: FetchProgress
+ :members:
+.. autoclass:: OpProgress
+ :members:
+.. autoclass:: CdromProgress
+ :members:
+.. autoclass:: DumbInstallProgress
+ :members:
+
+Implementing classes for text output
+------------------------------------
+.. autoclass:: TextFetchProgress
+ :members:
+.. autoclass:: OpTextProgress
+ :members:
+.. autoclass:: InstallProgress
+ :members:
+.. autoclass:: DpkgInstallProgress
+ :members:
+
+
+
+