From fbb6facf0135cf9cfde0f24e7beb132cb4d69f33 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Aug 2009 16:45:50 +0200 Subject: doc/source/c++/: Add C++ API documentation (no content yet). --- doc/source/c++/api.rst | 2 ++ doc/source/c++/embedding.rst | 2 ++ doc/source/c++/index.rst | 8 ++++++++ 3 files changed, 12 insertions(+) create mode 100644 doc/source/c++/api.rst create mode 100644 doc/source/c++/embedding.rst create mode 100644 doc/source/c++/index.rst (limited to 'doc/source/c++') diff --git a/doc/source/c++/api.rst b/doc/source/c++/api.rst new file mode 100644 index 00000000..fc1929e4 --- /dev/null +++ b/doc/source/c++/api.rst @@ -0,0 +1,2 @@ +Python APT C++ API +================== diff --git a/doc/source/c++/embedding.rst b/doc/source/c++/embedding.rst new file mode 100644 index 00000000..b6ab265a --- /dev/null +++ b/doc/source/c++/embedding.rst @@ -0,0 +1,2 @@ +Embedding Python APT +==================== diff --git a/doc/source/c++/index.rst b/doc/source/c++/index.rst new file mode 100644 index 00000000..8f598f3f --- /dev/null +++ b/doc/source/c++/index.rst @@ -0,0 +1,8 @@ +Python APT and C++ +================== + +.. toctree:: + :maxdepth: 1 + + api + embedding -- cgit v1.2.3 From c04ba87f403e624005c337f6440e68bbfacc4356 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 15 Jan 2010 17:48:17 +0100 Subject: Change version from 0.8 to 0.7.100 to indicate compatibility. --- doc/source/c++/api.rst | 4 + doc/source/c++/embedding.rst | 3 + doc/source/conf.py | 20 ++-- doc/source/templates/indexcontent.html | 2 +- doc/source/whatsnew/0.7.100.rst | 199 +++++++++++++++++++++++++++++++++ doc/source/whatsnew/0.8.0.rst | 185 ------------------------------ 6 files changed, 216 insertions(+), 197 deletions(-) create mode 100644 doc/source/whatsnew/0.7.100.rst delete mode 100644 doc/source/whatsnew/0.8.0.rst (limited to 'doc/source/c++') diff --git a/doc/source/c++/api.rst b/doc/source/c++/api.rst index fc1929e4..50788a5b 100644 --- a/doc/source/c++/api.rst +++ b/doc/source/c++/api.rst @@ -1,2 +1,6 @@ Python APT C++ API ================== + +.. note:: + + The C++ API is experimental and not really documented yet. diff --git a/doc/source/c++/embedding.rst b/doc/source/c++/embedding.rst index b6ab265a..e5816eb7 100644 --- a/doc/source/c++/embedding.rst +++ b/doc/source/c++/embedding.rst @@ -1,2 +1,5 @@ Embedding Python APT ==================== +.. note:: + + The C++ API is experimental and not really documented yet. diff --git a/doc/source/conf.py b/doc/source/conf.py index 0a9d5ed5..85ce61d8 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -19,17 +19,11 @@ import os import glob import sys -# If your extensions are in another directory, add it here. If the directory -# is relative to the documentation root, use os.path.abspath to make it -# absolute, like shown here. -sys.path.insert(0, os.path.abspath('..')) -sys.path.insert(0, os.path.abspath('../..')) - # Find the path to the built apt_pkg and apt_inst extensions if os.path.exists("../../build"): version = '.'.join(str(x) for x in sys.version_info[:2]) for apt_pkg_path in glob.glob('../../build/lib*%s/apt_pkg.so' % version): - sys.path.insert(0, os.path.dirname(apt_pkg_path)) + sys.path.insert(0, os.path.abspath(os.path.dirname(apt_pkg_path))) try: import apt_pkg except ImportError, exc: @@ -67,7 +61,7 @@ source_suffix = '.rst' # General information about the project. project = u'python-apt' -copyright = u'2009, Julian Andres Klode ' +copyright = u'2009-2010, Julian Andres Klode ' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -83,11 +77,15 @@ except KeyError: p2 = Popen(["sed", "-n", 's/^Version: //p'], stdin=p1.stdout, stdout=PIPE) release = p2.communicate()[0] -# Handle the alpha release scheme. +# Handle the alpha release scheme if int(release.split("~")[0].split(".")[2]) >= 90: version_s = release.split("~")[0].split(".")[:3] - version_s[1] = str(int(version_s[1]) + 1) - version_s[2] = "0" + # Set the version to 0.X.100 if the release is 0.X.9Y (0.7.90 => 0.7.100) + # Use + # version_s[1] = str(int(version_s[1]) + 1) + # version_s[2] = "0" + # if the version of a 0.X.9Y release should be 0.X+1.0 (0.7.90=>0.8) + version_s[2] = "100" version = '.'.join(version_s) del version_s else: diff --git a/doc/source/templates/indexcontent.html b/doc/source/templates/indexcontent.html index e5f11cc1..394b46d5 100644 --- a/doc/source/templates/indexcontent.html +++ b/doc/source/templates/indexcontent.html @@ -18,7 +18,7 @@

Parts of the documentation:

- diff --git a/doc/source/whatsnew/0.7.100.rst b/doc/source/whatsnew/0.7.100.rst new file mode 100644 index 00000000..110336a3 --- /dev/null +++ b/doc/source/whatsnew/0.7.100.rst @@ -0,0 +1,199 @@ +What's New In python-apt 0.7.100 +================================ +Python-apt 0.7.100 is a new major release of the python bindings for the APT +package management libraries. It provides support for Python 3, new language +features and an API conforming to :PEP:`8`. + +Despite the many changes made in python-apt 0.7.100, the release still provides +backwards compatibility to the 0.7 series. This makes it possible to run your +old applications. + +.. note:: + + Applications using the old API should be updated to the new API because + the old ones will be dropped in the 0.8 release. To build a python-apt + variant without the deprecated API, build it without the -DCOMPAT_0_7 + compiler flag. + +Support for Python 3 +-------------------- +Python-apt is the first Debian package to support the third major release of +Python. The port is straight forward and integrates as nicely in Python 3 as +the Python 2 builds integrate in Python 2. + +Please be aware that python-apt builds for Python 3 are built without the +compatibility options enabled for Python 2 builds. They also do not provide +methods like :meth:`has_key` on mapping objects, because it has been removed +in Python 3. + +Python 3 support may be disabled by distributions. + +Real classes in :mod:`apt_pkg` +------------------------------ +The 0.7.100 release introduces real classes in the :mod:`apt_pkg` extension. This +is an important step forward and makes writing code much easier, because you +can see the classes without having to create an object first. It also makes +it easier to talk about those classes, because they have a real name now. + +The 0.7 series shipped many functions for creating new objects, because the +classes were not exported. In 0.7.100, the classes themselves replace those +functions, as you can see in the following table. + +.. table:: + + ===================================== ================================= + Function Replacing class + ===================================== ================================= + :func:`apt_pkg.GetAcquire` :class:`apt_pkg.Acquire` + :func:`apt_pkg.GetCache()` :class:`apt_pkg.Cache` + :func:`apt_pkg.GetCdrom()` :class:`apt_pkg.Cdrom` + :func:`apt_pkg.GetDepCache()` :class:`apt_pkg.DepCache` + :func:`apt_pkg.GetPackageManager` :class:`apt_pkg.PackageManager` + :func:`apt_pkg.GetPkgAcqFile` :class:`apt_pkg.AcquireFile` + :func:`apt_pkg.GetPkgActionGroup` :class:`apt_pkg.ActionGroup` + :func:`apt_pkg.GetPkgProblemResolver` :class:`apt_pkg.ProblemResolver` + :func:`apt_pkg.GetPkgRecords` :class:`apt_pkg.PackageRecords` + :func:`apt_pkg.GetPkgSourceList` :class:`apt_pkg.SourceList` + :func:`apt_pkg.GetPkgSrcRecords` :class:`apt_pkg.SourceRecords` + :func:`apt_pkg.ParseSection` :class:`apt_pkg.TagSection` + :func:`apt_pkg.ParseTagFile` :class:`apt_pkg.TagFile` + ===================================== ================================= + +Complete rename of functions, methods and attributes +----------------------------------------------------- +In May 2008, Ben Finney reported bug 481061 against the python-apt package, +asking for PEP8 conformant names. With the release of python-apt 0.7.100, this +is finally happening. + +Context managers for the :keyword:`with` statement +-------------------------------------------------- +This is not a real big change, but it's good to have it: +:class:`apt_pkg.ActionGroup` can now be used as a context manager for the +:keyword:`with` statement. This makes it more obvious that you are using an +action group, and is just cooler:: + + with apt_pkg.ActionGroup(depcache): + for package in my_selected_packages: + depcache.mark_install(package) + +This also works for :class:`apt.Cache`:: + + with cache.actiongroup(): # cache is an Instance of apt.Cache + for package in my_selected_packages: + package.mark_install() # Instance of apt.Package + +Yet another context manager is available for locking the package system:: + + with apt_pkg.SystemLock(): + # do your stuff here + pass + +There is also one for file based locking:: + + with apt_pkg.FileLock(filename): + # do your stuff here + pass + + +Unification of dependency handling +---------------------------------- +In apt 0.7.XX, there were three different return types of functions parsing +dependencies. + +First of all, there were :func:`apt_pkg.ParseDepends()` and +:func:`apt_pkg.ParseSrcDepends()` which returned a list of or groups (which +are lists themselves) which contain tuples in the format ``(package,ver,op)``, +whereas op is one of "<=",">=","<<",">>","=","!=". + +Secondly, there was Package.DependsListStr which returned a dictionary mapping +the type of the dependency (e.g. 'Depends', 'Recommends') to a list similar to +those of :func:`apt_pkg.ParseDepends()`. The only difference was that the +values ">>", "<<" of op are ">", "<" instead. + +Thirdly, there was SourceRecords.BuildDepends, which returned a simple list +of tuples in the format ``(package, version, op, type)``, whereas ``op`` was +the integer representation of those ">>", "<<" actions and ``type`` an integer +representing the type of the dependency (e.g. 'Build-Depends'). The whole +format was almost useless from the Python perspective because the string +representations or constants for checking the values were not exported. + +python-apt 0.7.100 puts an end to this confusion and uses one basic format, which +is the format known from Package.DependsListStr. The format change only applies +to the new functions and attributes, i.e. :attr:`SourceRecords.build_depends` +will now return a dict, whereas :attr:`SourceRecords.BuildDepends` will still +return the classic format. The functions :func:`apt_pkg.parse_depends` and +:func:`apt_pkg.parse_src_depends` now use the same values for ``op`` as +:attr:`Package.DependsListStr` does. + +Example:: + + >>> s = apt_pkg.SourceRecords() + >>> s.lookup("apt") + 1 + >>> s.build_depends + {'Build-Depends': [[('debhelper', '5.0', '>=')], + [('libdb-dev', '', '')], + [('gettext', '0.12', '>=')], + [('libcurl4-gnutls-dev', '', ''), + ('libcurl3-gnutls-dev', '7.15.5', '>=')], + [('debiandoc-sgml', '', '')], + [('docbook-utils', '0.6.12', '>=')], + [('xsltproc', '', '')], + [('docbook-xsl', '', '')], + [('xmlto', '', '')]]} + >>> s.BuildDepends + [('debhelper', '5.0', 2, 0), + ('libdb-dev', '', 0, 0), + ('gettext', '0.12', 2, 0), + ('libcurl4-gnutls-dev', '', 16, 0), + ('libcurl3-gnutls-dev', '7.15.5', 2, 0), + ('debiandoc-sgml', '', 0, 0), + ('docbook-utils', '0.6.12', 2, 0), + ('xsltproc', '', 0, 0), + ('docbook-xsl', '', 0, 0), + ('xmlto', '', 0, 0)] + +C++ headers +------------ +The 0.7.100 release introduces python-apt-dev which provides headers for +developers to provide Python support in the libapt-pkg-using application. + +.. warning:: + + As of 0.7.93, those headers are still considered experimental and their + API may change without prior notice. + +Other changes +------------- +This release of python-apt also features several other, smaller changes: + + * Reduced memory usage by making :class:`apt.Cache` create + :class:`apt.Package()` object dynamically, instead of creating all of + them during the cache initialization. + * Support to set the candidate version in :class:`apt.package.Package` + +Porting your applications to python-apt 0.8 API +------------------------------------------------ +Porting your application to the new python-apt 0.8 API may be trivial. You +should download the source tarball of python-apt and run the tool +utils/migrate-0.8 using Python 2.6 over your code:: + + python2.6 utils/migrate-0.8.py -c myapp.py mypackage/ + +This will search your code for places where possibly deprecated names are +used. Using the argument ``-c``, you can turn colorized output on. + +Now that you know which parts of your code have to be changed, you have to know +how to do this. For classes, please look at the table. For all attributes, +methods, functions, and their parameters the following rules apply: + + 1. Replace leading [A-Z] with [a-z] (e.g DescURI => descURI) + 2. Replace multiple [A-Z] with [A-Z][a-z] (e.g. descURI => descUri) + 3. Replace every [A-Z] with the corresponding [a-z] (descUri => desc_uri) + +As an exception, refixes such as 'de' (e.g. 'dequote') or 'un' (e.g. 'unlock') +are normally not seperated by underscores from the next word. There are also +some other exceptions which are listed here, and apply to any name containing +this word: **filename**, **filesize**, **destdir**, **destfile**, **dequote**, +**unlock**, **reinstall**, **pinfile**, **REINSTREQ**, **UNPACKED**, +**parse_commandline**. diff --git a/doc/source/whatsnew/0.8.0.rst b/doc/source/whatsnew/0.8.0.rst deleted file mode 100644 index 8a2b52e8..00000000 --- a/doc/source/whatsnew/0.8.0.rst +++ /dev/null @@ -1,185 +0,0 @@ -What's New In python-apt 0.8 -============================ -Python-apt 0.8 is a new major release of the python bindings for the APT -package management libraries. It provides support for Python 3, new language -features and an API conforming to :PEP:`8`. - -Despite the many changes made in python-apt 0.8, the release still provides -backwards compatibility to the 0.7 series. This makes it possible to run your -old applications. Applications using the old API should be updated to the new -API, because the old one will be removed after some time. - -Support for Python 3 --------------------- -Python-apt is the first Debian package to support the third major release of -Python. The port is straight forward and integrates as nicely in Python 3 as -the Python 2 builds integrate in Python 2. - -Please be aware that python-apt builds for Python 3 are built without the -compatibility options enabled for Python 2 builds. They also do not provide -methods like :meth:`has_key` on mapping objects, because it has been removed -in Python 3. - -Real classes in :mod:`apt_pkg` ------------------------------- -The 0.8 release introduces real classes in the :mod:`apt_pkg` extension. This -is an important step forward and makes writing code much easier, because you -can see the classes without having to create an object first. It also makes -it easier to talk about those classes, because they have a real name now. - -The 0.7 series shipped many functions for creating new objects, because the -classes were not exported. In 0.8, the classes themselves replace those -functions, as you can see in the following table. - -.. table:: - - ===================================== ================================= - Function Replacing class - ===================================== ================================= - :func:`apt_pkg.GetAcquire` :class:`apt_pkg.Acquire` - :func:`apt_pkg.GetCache()` :class:`apt_pkg.Cache` - :func:`apt_pkg.GetCdrom()` :class:`apt_pkg.Cdrom` - :func:`apt_pkg.GetDepCache()` :class:`apt_pkg.DepCache` - :func:`apt_pkg.GetPackageManager` :class:`apt_pkg.PackageManager` - :func:`apt_pkg.GetPkgAcqFile` :class:`apt_pkg.AcquireFile` - :func:`apt_pkg.GetPkgActionGroup` :class:`apt_pkg.ActionGroup` - :func:`apt_pkg.GetPkgProblemResolver` :class:`apt_pkg.ProblemResolver` - :func:`apt_pkg.GetPkgRecords` :class:`apt_pkg.PackageRecords` - :func:`apt_pkg.GetPkgSourceList` :class:`apt_pkg.SourceList` - :func:`apt_pkg.GetPkgSrcRecords` :class:`apt_pkg.SourceRecords` - :func:`apt_pkg.ParseSection` :class:`apt_pkg.TagSection` - :func:`apt_pkg.ParseTagFile` :class:`apt_pkg.TagFile` - ===================================== ================================= - -Complete rename of functions, methods and attributes ------------------------------------------------------ -In May 2008, Ben Finney reported bug 481061 against the python-apt package, -asking for PEP8 conformant names. With the release of python-apt 0.8, this -is finally happening. - -Context managers for the :keyword:`with` statement --------------------------------------------------- -This is not a real big change, but it's good to have it: -:class:`apt_pkg.ActionGroup` can now be used as a context manager for the -:keyword:`with` statement. This makes it more obvious that you are using an -action group, and is just cooler:: - - with apt_pkg.ActionGroup(depcache): - for package in my_selected_packages: - depcache.mark_install(package) - -This also works for :class:`apt.Cache`:: - - with cache.actiongroup(): # cache is an Instance of apt.Cache - for package in my_selected_packages: - package.mark_install() # Instance of apt.Package - -Yet another context manager is available for locking the package system:: - - with apt_pkg.SystemLock(): - # do your stuff here - pass - -There is also one for file based locking:: - - with apt_pkg.FileLock(filename): - # do your stuff here - pass - - -Unification of dependency handling ----------------------------------- -In apt 0.7, there were three different return types of functions parsing -dependencies. - -First of all, there were :func:`apt_pkg.ParseDepends()` and -:func:`apt_pkg.ParseSrcDepends()` which returned a list of or groups (which -are lists themselves) which contain tuples in the format ``(package,ver,op)``, -whereas op is one of "<=",">=","<<",">>","=","!=". - -Secondly, there was Package.DependsListStr which returned a dictionary mapping -the type of the dependency (e.g. 'Depends', 'Recommends') to a list similar to -those of :func:`apt_pkg.ParseDepends()`. The only difference was that the -values ">>", "<<" of op are ">", "<" instead. - -Thirdly, there was SourceRecords.BuildDepends, which returned a simple list -of tuples in the format ``(package, version, op, type)``, whereas ``op`` was -the integer representation of those ">>", "<<" actions and ``type`` an integer -representing the type of the dependency (e.g. 'Build-Depends'). The whole -format was almost useless from the Python perspective because the string -representations or constants for checking the values were not exported. - -python-apt 0.8 puts an end to this confusion and uses one basic format, which -is the format known from Package.DependsListStr. The format change only applies -to the new functions and attributes, i.e. :attr:`SourceRecords.build_depends` -will now return a dict, whereas :attr:`SourceRecords.BuildDepends` will still -return the classic format. The functions :func:`apt_pkg.parse_depends` and -:func:`apt_pkg.parse_src_depends` now use the same values for ``op`` as -:attr:`Package.DependsListStr` does. - -Example:: - - >>> s = apt_pkg.SourceRecords() - >>> s.lookup("apt") - 1 - >>> s.build_depends - {'Build-Depends': [[('debhelper', '5.0', '>=')], - [('libdb-dev', '', '')], - [('gettext', '0.12', '>=')], - [('libcurl4-gnutls-dev', '', ''), - ('libcurl3-gnutls-dev', '7.15.5', '>=')], - [('debiandoc-sgml', '', '')], - [('docbook-utils', '0.6.12', '>=')], - [('xsltproc', '', '')], - [('docbook-xsl', '', '')], - [('xmlto', '', '')]]} - >>> s.BuildDepends - [('debhelper', '5.0', 2, 0), - ('libdb-dev', '', 0, 0), - ('gettext', '0.12', 2, 0), - ('libcurl4-gnutls-dev', '', 16, 0), - ('libcurl3-gnutls-dev', '7.15.5', 2, 0), - ('debiandoc-sgml', '', 0, 0), - ('docbook-utils', '0.6.12', 2, 0), - ('xsltproc', '', 0, 0), - ('docbook-xsl', '', 0, 0), - ('xmlto', '', 0, 0)] - - - - - -Other changes -------------- -This release of python-apt also features several other, smaller changes: - - * Reduced memory usage by making :class:`apt.Cache` create - :class:`apt.Package()` object dynamically, instead of creating all of - them during the cache initialization. - * Support to set the candidate version in :class:`apt.package.Package` - -Porting your applications to python-apt 0.8 -------------------------------------------- -Porting your application to python-apt 0.8 may be trivial. You should download -the source tarball of python-apt and run the tool utils/migrate-0.8 using -Python 2.6 over your code:: - - python2.6 utils/migrate-0.8.py -c myapp.py mypackage/ - -This will search your code for places where possibly deprecated names are -used. Using the argument ``-c``, you can turn colorized output on. - -Now that you know which parts of your code have to be changed, you have to know -how to do this. For classes, please look at the table. For all attributes, -methods, functions, and their parameters the following rules apply: - - 1. Replace leading [A-Z] with [a-z] (e.g DescURI => descURI) - 2. Replace multiple [A-Z] with [A-Z][a-z] (e.g. descURI => descUri) - 3. Replace every [A-Z] with the corresponding [a-z] (descUri => desc_uri) - -As an exception, refixes such as 'de' (e.g. 'dequote') or 'un' (e.g. 'unlock') -are normally not seperated by underscores from the next word. There are also -some other exceptions which are listed here, and apply to any name containing -this word: **filename**, **filesize**, **destdir**, **destfile**, **dequote**, -**unlock**, **reinstall**, **pinfile**, **REINSTREQ**, **UNPACKED**, -**parse_commandline**. -- cgit v1.2.3 From 074ecc0a9157027d7dbeff4fe70f0668eb5b93cb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 20 Jan 2010 16:46:03 +0100 Subject: doc/source/c++/api.rst: Document the C++ bindings. --- doc/source/c++/api.rst | 797 ++++++++++++++++++++++++++++++++++++++++++- doc/source/c++/embedding.rst | 26 +- 2 files changed, 820 insertions(+), 3 deletions(-) (limited to 'doc/source/c++') diff --git a/doc/source/c++/api.rst b/doc/source/c++/api.rst index 50788a5b..2abd3ab8 100644 --- a/doc/source/c++/api.rst +++ b/doc/source/c++/api.rst @@ -1,6 +1,801 @@ Python APT C++ API ================== +The C++ API provides functions to create Python objects from C++ objects and +to retrieve the C++ object stored in the Python object. There are two types +of Python objects: owned ones and unowned ones. An owned object has another +Python object as its owner and keeps its owner alive for its lifetime. An +unowned object has no such owner. + +The C++ API names use the name of the class in apt_pkg and are prefixed with +Py. For each supported class, there is a _Type object, a _Check() function, +a _CheckExact() function, a _FromCpp() and a _ToCpp() function. .. note:: - The C++ API is experimental and not really documented yet. + This API is experimental and should not be used in stable program + releases. + +Acquire (pkgAcquire) +-------------------- +.. cvar:: PyTypeObject PyAcquire_Type + + The type object for :class:`apt_pkg.Acquire` objects. + +.. cfunction:: int PyAcquire_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Acquire` object, or + a subclass thereof. + +.. cfunction:: int PyAcquire_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Acquire` object and no + subclass thereof. + +.. cfunction:: PyObject* PyAcquire_FromCpp(pkgAcquire *acquire, bool delete=false) + + Create a new :class:`apt_pkg.Acquire` object from the :ctype:`pkgAcquire` + pointer given by the parameter *acquire*. If the parameter *delete* is + true, the object pointed to by *acquire* will be deleted when the refcount + of the return value reaches 0. + +.. cfunction:: pkgAcquire* PyAcquire_ToCpp(PyObject *acquire) + + Return the :ctype:`pkgAcquire` pointer contained in the Python object + *acquire*. + + +AcquireFile (pkgAcqFile) +------------------------ +.. cvar:: PyTypeObject PyAcquireFile_Type + + The type object for :class:`apt_pkg.AcquireFile` objects. + +.. cfunction:: int PyAcquireFile_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireFile` object, or + a subclass thereof. + +.. cfunction:: int PyAcquireFile_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireFile` object + and no subclass thereof. + +.. cfunction:: PyObject* PyAcquireFile_FromCpp(pkgAcqFile *file, bool delete=false, PyObject *owner=NULL) + + Create a new :class:`apt_pkg.AcquireFile` object from the :ctype:`pkgAcqFile` + pointer given by the parameter *file*. If the parameter *delete* is + true, the object pointed to by *file* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should point + to a :class:`apt_pkg.Acquire` object. + +.. cfunction:: pkgAcqFile* PyAcquireFile_ToCpp(PyObject *acquire) + + Return the :ctype:`pkgAcqFile` pointer contained in the Python object + *acquire*. + +AcquireItem (pkgAcquire::Item) +------------------------------ +.. cvar:: PyTypeObject PyAcquireItem_Type + + The type object for :class:`apt_pkg.AcquireItem` objects. + +.. cfunction:: int PyAcquireItem_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireItem` object, or + a subclass thereof. + +.. cfunction:: int PyAcquireItem_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireItem` object + and no subclass thereof. + +.. cfunction:: PyObject* PyAcquireItem_FromCpp(pkgAcquire::Item *item, bool delete=false, PyObject *owner=NULL) + + Create a new :class:`apt_pkg.AcquireItem` object from the :ctype:`pkgAcquire::Item` + pointer given by the parameter *item*. If the parameter *delete* is + true, the object pointed to by *item* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should point + to a :class:`apt_pkg.Acquire` object. + +.. cfunction:: pkgAcquire::Item* PyAcquireItem_ToCpp(PyObject *object) + + Return the :ctype:`pkgAcquire::Item` pointer contained in the Python object + *object*. + +AcquireItemDesc (pkgAcquire::ItemDesc) +-------------------------------------- +.. cvar:: PyTypeObject PyAcquireItemDesc_Type + + The type object for :class:`apt_pkg.AcquireItemDesc` objects. + +.. cfunction:: int PyAcquireItemDesc_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireItemDesc` object, or + a subclass thereof. + +.. cfunction:: int PyAcquireItemDesc_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireItemDesc` object + and no subclass thereof. + +.. cfunction:: PyObject* PyAcquireItemDesc_FromCpp(pkgAcquire::ItemDesc *desc, bool delete=false, PyObject *owner=NULL) + + Create a new :class:`apt_pkg.AcquireItemDesc` object from the :ctype:`pkgAcquire::ItemDesc` + pointer given by the parameter *desc*. If the parameter *delete* is + true, the object pointed to by *desc* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should point + to a :class:`apt_pkg.AcquireItem` object. + +.. cfunction:: pkgAcquire::ItemDesc* PyAcquireItemDesc_ToCpp(PyObject *object) + + Return the :ctype:`pkgAcquire::ItemDesc` pointer contained in the Python object + *object*. + +AcquireWorker (pkgAcquire::Worker) +---------------------------------- +.. cvar:: PyTypeObject PyAcquireWorker_Type + + The type object for :class:`apt_pkg.AcquireWorker` objects. + +.. cfunction:: int PyAcquireWorker_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireWorker` object, or + a subclass thereof. + +.. cfunction:: int PyAcquireWorker_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.AcquireWorker` object + and no subclass thereof. + +.. cfunction:: PyObject* PyAcquireWorker_FromCpp(pkgAcquire::Worker *worker, bool delete=false, PyObject *owner=NULL) + + Create a new :class:`apt_pkg.AcquireWorker` object from the :ctype:`pkgAcquire::Worker` + pointer given by the parameter *worker*. If the parameter *delete* is + true, the object pointed to by *worker* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should point + to a :class:`apt_pkg.Acquire` object. + +.. cfunction:: pkgAcquire::Worker* PyAcquireWorker_ToCpp(PyObject *object) + + Return the :ctype:`pkgAcquire::Worker` pointer contained in the Python object + *object*. + +ActionGroup (pkgDepCache::ActionGroup) +-------------------------------------- +.. cvar:: PyTypeObject PyActionGroup_Type + + The type object for :class:`apt_pkg.ActionGroup` objects. + +.. cfunction:: int PyActionGroup_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.ActionGroup` object, or + a subclass thereof. + +.. cfunction:: int PyActionGroup_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.ActionGroup` object + and no subclass thereof. + +.. cfunction:: PyObject* PyActionGroup_FromCpp(pkgDepCache::ActionGroup *agroup, bool delete=false, PyObject *owner=NULL) + + Create a new :class:`apt_pkg.ActionGroup` object from the :ctype:`pkgDepCache::ActionGroup` + pointer given by the parameter *agroup*. If the parameter *delete* is + true, the object pointed to by *agroup* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should point + to a :class:`apt_pkg.DepCache` object. + +.. cfunction:: pkgDepCache::ActionGroup* PyActionGroup_ToCpp(PyObject *object) + + Return the :ctype:`pkgDepCache::ActionGroup` pointer contained in the + Python object *object*. + +Cache (pkgCache) +------------------------ +.. cvar:: PyTypeObject PyCache_Type + + The type object for :class:`apt_pkg.Cache` objects. + +.. cfunction:: int PyCache_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Cache` object, or + a subclass thereof. + +.. cfunction:: int PyCache_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Cache` object + and no subclass thereof. + +.. cfunction:: PyObject* PyCache_FromCpp(pkgCache *cache, bool delete=false, PyObject *owner=NULL) + + Create a new :class:`apt_pkg.Cache` object from the :ctype:`pkgCache` + pointer given by the parameter *cache*. If the parameter *delete* is + true, the object pointed to by *cache* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* shall point + to a object of the type :cdata:`PyCacheFile_Type`. + +.. cfunction:: pkgCache* PyCache_ToCpp(PyObject *object) + + Return the :ctype:`pkgCache` pointer contained in the Python object + *object*. + + +CacheFile (pkgCacheFile) +------------------------ +.. cvar:: PyTypeObject PyCacheFile_Type + + The type object for CacheFile. This type is internal and not exported to + Python anywhere. + +.. cfunction:: int PyCacheFile_Check(PyObject *object) + + Check that the object *object* is of the type :cdata:`PyCacheFile_Type` or + a subclass thereof. + +.. cfunction:: int PyCacheFile_CheckExact(PyObject *object) + + Check that the object *object* is of the type :cdata:`PyCacheFile_Type` and + no subclass thereof. + +.. cfunction:: PyObject* PyCacheFile_FromCpp(pkgCacheFile *file, bool delete=false) + + Create a new :class:`apt_pkg.CacheFile` object from the :ctype:`pkgCacheFile` + pointer given by the parameter *file* If the parameter *delete* is + true, the object pointed to by *file* will be deleted when the reference + count of the returned object reaches 0. + +.. cfunction:: pkgCacheFile* PyCacheFile_ToCpp(PyObject *object) + + Return the :ctype:`pkgCacheFile` pointer contained in the Python object + *object*. + +Cdrom (pkgCdrom) +------------------------ +.. cvar:: PyTypeObject PyCdrom_Type + + The type object for :class:`apt_pkg.Cdrom` objects. + +.. cfunction:: int PyCdrom_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Cdrom` object, or + a subclass thereof. + +.. cfunction:: int PyCdrom_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Cdrom` object + and no subclass thereof. + +.. cfunction:: PyObject* PyCdrom_FromCpp(pkgCdrom &cdrom, bool delete=false) + + Create a new :class:`apt_pkg.Cdrom` object from the :ctype:`pkgCdrom` + reference given by the parameter *cdrom*. If the parameter *delete* is + true, *cdrom* will be deleted when the reference count of the returned + object reaches 0. + +.. cfunction:: pkgCdrom& PyCdrom_ToCpp(PyObject *object) + + Return the :ctype:`pkgCdrom` reference contained in the Python object + *object*. + +Configuration (Configuration) +------------------------------- +.. cvar:: PyTypeObject PyConfiguration_Type + + The type object for :class:`apt_pkg.Configuration` objects. + +.. cfunction:: int PyConfiguration_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Configuration` object, or + a subclass thereof. + +.. cfunction:: int PyConfiguration_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Configuration` object + and no subclass thereof. + +.. cfunction:: PyObject* PyConfiguration_FromCpp(Configuration *cpp, bool delete=false, PyObject *owner=null) + + Create a new :class:`apt_pkg.Configuration` object from the :ctype:`Configuration` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* may refer to + a parent object (e.g. when exposing a sub tree of a configuration object). + +.. cfunction:: Configuration* PyConfiguration_ToCpp(PyObject *object) + + Return the :ctype:`Configuration` pointer contained in the Python object + *object*. + +DepCache (pkgDepCache) +------------------------ +.. cvar:: PyTypeObject PyDepCache_Type + + The type object for :class:`apt_pkg.DepCache` objects. + +.. cfunction:: int PyDepCache_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.DepCache` object, or + a subclass thereof. + +.. cfunction:: int PyDepCache_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.DepCache` object + and no subclass thereof. + +.. cfunction:: PyObject* PyDepCache_FromCpp(pkgDepCache *cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.DepCache` object from the :ctype:`pkgDepCache` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* must be + a PyObject of the type :cdata:`PyCache_Type`. + +.. cfunction:: pkgDepCache* PyDepCache_ToCpp(PyObject *object) + + Return the :ctype:`pkgDepCache` pointer contained in the Python object + *object*. + +Dependency (pkgCache::DepIterator) +---------------------------------- +.. cvar:: PyTypeObject PyDependency_Type + + The type object for :class:`apt_pkg.Dependency` objects. + +.. cfunction:: int PyDependency_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Dependency` object, or + a subclass thereof. + +.. cfunction:: int PyDependency_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Dependency` object + and no subclass thereof. + +.. cfunction:: PyObject* PyDependency_FromCpp(pkgCache::DepIterator &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.Dependency` object from the :ctype:`pkgCache::DepIterator` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* must be + a PyObject of the type :cdata:`PyPackage_Type`. + +.. cfunction:: pkgCache::DepIterator& PyDependency_ToCpp(PyObject *object) + + Return the :ctype:`pkgCache::DepIterator` reference contained in the + Python object *object*. + +Description (pkgCache::DescIterator) +------------------------------------ +.. cvar:: PyTypeObject PyDescription_Type + + The type object for :class:`apt_pkg.Description` objects. + +.. cfunction:: int PyDescription_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Description` object, or + a subclass thereof. + +.. cfunction:: int PyDescription_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Description` object + and no subclass thereof. + +.. cfunction:: PyObject* PyDescription_FromCpp(pkgCache::DescIterator &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.Description` object from the :ctype:`pkgCache::DescIterator` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* must be + a PyObject of the type :cdata:`PyPackage_Type`. + +.. cfunction:: pkgCache::DescIterator& PyDescription_ToCpp(PyObject *object) + + Return the :ctype:`pkgCache::DescIterator` reference contained in the + Python object *object*. + +Hashes (Hashes) +---------------------------------- +.. cvar:: PyTypeObject PyHashes_Type + + The type object for :class:`apt_pkg.Hashes` objects. + +.. cfunction:: int PyHashes_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Hashes` object, or + a subclass thereof. + +.. cfunction:: int PyHashes_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Hashes` object + and no subclass thereof. + +.. cfunction:: PyObject* PyHashes_FromCpp(Hashes &cpp, bool delete=false) + + Create a new :class:`apt_pkg.Hashes` object from the :ctype:`Hashes` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference count of the returned + object reaches 0. + +.. cfunction:: Hashes& PyHashes_ToCpp(PyObject *object) + + Return the :ctype:`Hashes` reference contained in the + Python object *object*. + +HashString (HashString) +------------------------ +.. cvar:: PyTypeObject PyHashString_Type + + The type object for :class:`apt_pkg.HashString` objects. + +.. cfunction:: int PyHashString_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.HashString` object, or + a subclass thereof. + +.. cfunction:: int PyHashString_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.HashString` object + and no subclass thereof. + +.. cfunction:: PyObject* PyHashString_FromCpp(HashString *cpp, bool delete=false) + + Create a new :class:`apt_pkg.HashString` object from the :ctype:`HashString` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. + +.. cfunction:: HashString* PyHashString_ToCpp(PyObject *object) + + Return the :ctype:`HashString` pointer contained in the Python object + *object*. + +IndexRecords (indexRecords) +---------------------------- +.. cvar:: PyTypeObject PyIndexRecords_Type + + The type object for :class:`apt_pkg.IndexRecords` objects. + +.. cfunction:: int PyIndexRecords_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.IndexRecords` object, or + a subclass thereof. + +.. cfunction:: int PyIndexRecords_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.IndexRecords` object + and no subclass thereof. + +.. cfunction:: PyObject* PyIndexRecords_FromCpp(indexRecords *cpp, bool delete=false) + + Create a new :class:`apt_pkg.IndexRecords` object from the :ctype:`indexRecords` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. + +.. cfunction:: indexRecords* PyIndexRecords_ToCpp(PyObject *object) + + Return the :ctype:`indexRecords` pointer contained in the Python object + *object*. + + +MetaIndex (metaIndex) +------------------------ +.. cvar:: PyTypeObject PyMetaIndex_Type + + The type object for :class:`apt_pkg.MetaIndex` objects. + +.. cfunction:: int PyMetaIndex_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.MetaIndex` object, or + a subclass thereof. + +.. cfunction:: int PyMetaIndex_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.MetaIndex` object + and no subclass thereof. + +.. cfunction:: PyObject* PyMetaIndex_FromCpp(metaIndex *cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.MetaIndex` object from the :ctype:`metaIndex` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should be + a PyObject of the type :cdata:`PySourceList_Type`. + +.. cfunction:: metaIndex* PyMetaIndex_ToCpp(PyObject *object) + + Return the :ctype:`metaIndex` pointer contained in the Python object + *object*. + +Package (pkgCache::PkgIterator) +---------------------------------- +.. cvar:: PyTypeObject PyPackage_Type + + The type object for :class:`apt_pkg.Package` objects. + +.. cfunction:: int PyPackage_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Package` object, or + a subclass thereof. + +.. cfunction:: int PyPackage_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Package` object + and no subclass thereof. + +.. cfunction:: PyObject* PyPackage_FromCpp(pkgCache::PkgIterator &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.Package` object from the :ctype:`pkgCache::PkgIterator` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should be + a PyObject of the type :cdata:`PyCache_Type`. + +.. cfunction:: pkgCache::PkgIterator& PyPackage_ToCpp(PyObject *object) + + Return the :ctype:`pkgCache::PkgIterator` reference contained in the + Python object *object*. + +PackageFile (pkgCache::PkgFileIterator) +---------------------------------------- +.. cvar:: PyTypeObject PyPackageFile_Type + + The type object for :class:`apt_pkg.PackageFile` objects. + +.. cfunction:: int PyPackageFile_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.PackageFile` object, or + a subclass thereof. + +.. cfunction:: int PyPackageFile_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.PackageFile` object + and no subclass thereof. + +.. cfunction:: PyObject* PyPackageFile_FromCpp(pkgCache::PkgFileIterator &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.PackageFile` object from the :ctype:`pkgCache::PkgFileIterator` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should be + a PyObject of the type :cdata:`PyCache_Type`. + +.. cfunction:: pkgCache::PkgFileIterator& PyPackageFile_ToCpp(PyObject *object) + + Return the :ctype:`pkgCache::PkgFileIterator` reference contained in the + Python object *object*. + +PackageIndexFile (pkgIndexFile) +-------------------------------------- +.. cvar:: PyTypeObject PyPackageIndexFile_Type + + The type object for :class:`apt_pkg.PackageIndexFile` objects. + +.. cfunction:: int PyPackageIndexFile_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.PackageIndexFile` object, or + a subclass thereof. + +.. cfunction:: int PyPackageIndexFile_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.PackageIndexFile` object + and no subclass thereof. + +.. cfunction:: PyObject* PyPackageIndexFile_FromCpp(pkgIndexFile *cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.PackageIndexFile` object from the :ctype:`pkgIndexFile` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* should be + a PyObject of the type :cdata:`PyMetaIndex_Type`. + +.. cfunction:: pkgIndexFile* PyPackageIndexFile_ToCpp(PyObject *object) + + Return the :ctype:`pkgIndexFile` pointer contained in the Python object + *object*. + + +PackageManager (pkgPackageManager) +---------------------------------- +.. cvar:: PyTypeObject PyPackageManager_Type + + The type object for :class:`apt_pkg.PackageManager` objects. + +.. cfunction:: int PyPackageManager_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.PackageManager` object, or + a subclass thereof. + +.. cfunction:: int PyPackageManager_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.PackageManager` object + and no subclass thereof. + +.. cfunction:: PyObject* PyPackageManager_FromCpp(pkgPackageManager *cpp, bool delete=false) + + Create a new :class:`apt_pkg.PackageManager` object from the :ctype:`pkgPackageManager` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. + +.. cfunction:: pkgPackageManager* PyPackageManager_ToCpp(PyObject *object) + + Return the :ctype:`pkgPackageManager` pointer contained in the Python object + *object*. + + +Policy (pkgPolicy) +------------------ +.. cvar:: PyTypeObject PyPolicy_Type + + The type object for :class:`apt_pkg.Policy` objects. + +.. cfunction:: int PyPolicy_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Policy` object, or + a subclass thereof. + +.. cfunction:: int PyPolicy_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Policy` object + and no subclass thereof. + +.. cfunction:: PyObject* PyPolicy_FromCpp(pkgPolicy *cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.Policy` object from the :ctype:`pkgPolicy` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* must be + a PyObject of the type :cdata:`PyCache_Type`. + +.. cfunction:: pkgPolicy* PyPolicy_ToCpp(PyObject *object) + + Return the :ctype:`pkgPolicy` pointer contained in the Python object + *object*. + + +ProblemResolver (pkgProblemResolver) +-------------------------------------- +.. cvar:: PyTypeObject PyProblemResolver_Type + + The type object for :class:`apt_pkg.ProblemResolver` objects. + +.. cfunction:: int PyProblemResolver_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.ProblemResolver` object, or + a subclass thereof. + +.. cfunction:: int PyProblemResolver_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.ProblemResolver` object + and no subclass thereof. + +.. cfunction:: PyObject* PyProblemResolver_FromCpp(pkgProblemResolver *cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.ProblemResolver` object from the :ctype:`pkgProblemResolver` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* must be + a PyObject of the type :cdata:`PyDepCache_Type`. + +.. cfunction:: pkgProblemResolver* PyProblemResolver_ToCpp(PyObject *object) + + Return the :ctype:`pkgProblemResolver` pointer contained in the Python object + *object*. + + + +SourceList (pkgSourceList) +--------------------------- +.. cvar:: PyTypeObject PySourceList_Type + + The type object for :class:`apt_pkg.SourceList` objects. + +.. cfunction:: int PySourceList_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.SourceList` object, or + a subclass thereof. + +.. cfunction:: int PySourceList_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.SourceList` object + and no subclass thereof. + +.. cfunction:: PyObject* PySourceList_FromCpp(pkgSourceList *cpp, bool delete=false) + + Create a new :class:`apt_pkg.SourceList` object from the :ctype:`pkgSourceList` + pointer given by the parameter *cpp*. If the parameter *delete* is + true, the object pointed to by *cpp* will be deleted when the reference + count of the returned object reaches 0. + +.. cfunction:: pkgSourceList* PySourceList_ToCpp(PyObject *object) + + Return the :ctype:`pkgSourceList` pointer contained in the Python object + *object*. + + +TagFile (pkgTagFile) +---------------------------------- +.. cvar:: PyTypeObject PyTagFile_Type + + The type object for :class:`apt_pkg.TagFile` objects. + +.. cfunction:: int PyTagFile_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.TagFile` object, or + a subclass thereof. + +.. cfunction:: int PyTagFile_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.TagFile` object + and no subclass thereof. + +.. cfunction:: PyObject* PyTagFile_FromCpp(pkgTagFile &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.TagFile` object from the :ctype:`pkgTagFile` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* may be any + Python object. + +.. cfunction:: pkgTagFile& PyTagFile_ToCpp(PyObject *object) + + Return the :ctype:`pkgTagFile` reference contained in the + Python object *object*. + +TagSection (pkgTagSection) +---------------------------------- +.. cvar:: PyTypeObject PyTagSection_Type + + The type object for :class:`apt_pkg.TagSection` objects. + +.. cfunction:: int PyTagSection_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.TagSection` object, or + a subclass thereof. + +.. cfunction:: int PyTagSection_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.TagSection` object + and no subclass thereof. + +.. cfunction:: PyObject* PyTagSection_FromCpp(pkgTagSection &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.TagSection` object from the :ctype:`pkgTagSection` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* may be + a PyObject of the type :cdata:`PyTagFile_Type`. + +.. cfunction:: pkgTagSection& PyTagSection_ToCpp(PyObject *object) + + Return the :ctype:`pkgTagSection` reference contained in the + Python object *object*. + +Version (pkgCache::VerIterator) +---------------------------------- +.. cvar:: PyTypeObject PyVersion_Type + + The type object for :class:`apt_pkg.Version` objects. + +.. cfunction:: int PyVersion_Check(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Version` object, or + a subclass thereof. + +.. cfunction:: int PyVersion_CheckExact(PyObject *object) + + Check that the object *object* is an :class:`apt_pkg.Version` object + and no subclass thereof. + +.. cfunction:: PyObject* PyVersion_FromCpp(pkgCache::VerIterator &cpp, bool delete=false, PyObject *owner) + + Create a new :class:`apt_pkg.Version` object from the :ctype:`pkgCache::VerIterator` + reference given by the parameter *cpp*. If the parameter *delete* is + true, *cpp* will be deleted when the reference + count of the returned object reaches 0. The parameter *owner* must be + a PyObject of the type :cdata:`PyPackage_Type`. + +.. cfunction:: pkgCache::VerIterator& PyVersion_ToCpp(PyObject *object) + + Return the :ctype:`pkgCache::VerIterator` reference contained in the + Python object *object*. diff --git a/doc/source/c++/embedding.rst b/doc/source/c++/embedding.rst index e5816eb7..b04e0d78 100644 --- a/doc/source/c++/embedding.rst +++ b/doc/source/c++/embedding.rst @@ -1,5 +1,27 @@ +.. highlightlang:: c++ + Embedding Python APT ==================== -.. note:: +This is a very basic tutorial for working with the C++ bindings. + +Basics +------- +To use the python-apt C++ bindings, first include the +``python-apt/python-apt.h`` header:: + + #include + +Now, the module needs to be initialized. This is done by calling the function +:cfunc:`import_apt_pkg`. This function returns 0 on success and a negative +value in case of failure:: + + if (import_apt_pkg() < 0) + return; + +Longer example +-------------- +The following code will create a standalone application which provides a +module ``client`` with the attribute ``hash`` which stores an object of the +type :class:`apt_pkg.HashString`: - The C++ API is experimental and not really documented yet. +.. literalinclude:: ../../client-example.cc -- cgit v1.2.3 From 86bad92b26e6c7af7deb7dfcdd25e70ce1ce5a85 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 20 Jan 2010 16:58:54 +0100 Subject: doc/source/c++/embedding.rst: Add compile command. --- doc/source/c++/embedding.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/source/c++') diff --git a/doc/source/c++/embedding.rst b/doc/source/c++/embedding.rst index b04e0d78..754ad398 100644 --- a/doc/source/c++/embedding.rst +++ b/doc/source/c++/embedding.rst @@ -25,3 +25,10 @@ module ``client`` with the attribute ``hash`` which stores an object of the type :class:`apt_pkg.HashString`: .. literalinclude:: ../../client-example.cc + + +.. highlightlang:: sh + +If this file were called client-example.cc, you could compile it using:: + + g++ -lapt-pkg -lpython2.5 -I/usr/include/python2.5 -o client client-example.cc -- cgit v1.2.3 From 2e32d8d27f84b585ef8196a28bdd2e649de02607 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 20 Jan 2010 17:06:11 +0100 Subject: Rename apt_pkg.PackageIndexFile to apt_pkg.IndexFile. --- debian/changelog | 1 + doc/source/c++/api.rst | 20 +++++++-------- doc/source/library/apt_pkg.rst | 6 ++--- python/apt_pkgmodule.cc | 4 +-- python/apt_pkgmodule.h | 2 +- python/indexfile.cc | 58 +++++++++++++++++++++--------------------- python/metaindex.cc | 2 +- python/pkgsrcrecords.cc | 2 +- python/python-apt.h | 10 ++++---- python/sourcelist.cc | 4 +-- 10 files changed, 55 insertions(+), 54 deletions(-) (limited to 'doc/source/c++') diff --git a/debian/changelog b/debian/changelog index 7b711e1d..409cf44e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ python-apt (0.7.93) UNRELEASED; urgency=low - Fix some parsing of dpkg status fd. * apt/progress/text.py: - Replace one print statement with a .write() call. + * Rename apt_pkg.PackageIndexFile to apt_pkg.IndexFile. [ Colin Watson ] * apt/progress/__init__.py: diff --git a/doc/source/c++/api.rst b/doc/source/c++/api.rst index 2abd3ab8..749e2bc0 100644 --- a/doc/source/c++/api.rst +++ b/doc/source/c++/api.rst @@ -564,31 +564,31 @@ PackageFile (pkgCache::PkgFileIterator) Return the :ctype:`pkgCache::PkgFileIterator` reference contained in the Python object *object*. -PackageIndexFile (pkgIndexFile) +IndexFile (pkgIndexFile) -------------------------------------- -.. cvar:: PyTypeObject PyPackageIndexFile_Type +.. cvar:: PyTypeObject PyIndexFile_Type - The type object for :class:`apt_pkg.PackageIndexFile` objects. + The type object for :class:`apt_pkg.IndexFile` objects. -.. cfunction:: int PyPackageIndexFile_Check(PyObject *object) +.. cfunction:: int PyIndexFile_Check(PyObject *object) - Check that the object *object* is an :class:`apt_pkg.PackageIndexFile` object, or + Check that the object *object* is an :class:`apt_pkg.IndexFile` object, or a subclass thereof. -.. cfunction:: int PyPackageIndexFile_CheckExact(PyObject *object) +.. cfunction:: int PyIndexFile_CheckExact(PyObject *object) - Check that the object *object* is an :class:`apt_pkg.PackageIndexFile` object + Check that the object *object* is an :class:`apt_pkg.IndexFile` object and no subclass thereof. -.. cfunction:: PyObject* PyPackageIndexFile_FromCpp(pkgIndexFile *cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyIndexFile_FromCpp(pkgIndexFile *cpp, bool delete=false, PyObject *owner) - Create a new :class:`apt_pkg.PackageIndexFile` object from the :ctype:`pkgIndexFile` + Create a new :class:`apt_pkg.IndexFile` object from the :ctype:`pkgIndexFile` pointer given by the parameter *cpp*. If the parameter *delete* is true, the object pointed to by *cpp* will be deleted when the reference count of the returned object reaches 0. The parameter *owner* should be a PyObject of the type :cdata:`PyMetaIndex_Type`. -.. cfunction:: pkgIndexFile* PyPackageIndexFile_ToCpp(PyObject *object) +.. cfunction:: pkgIndexFile* PyIndexFile_ToCpp(PyObject *object) Return the :ctype:`pkgIndexFile` pointer contained in the Python object *object*. diff --git a/doc/source/library/apt_pkg.rst b/doc/source/library/apt_pkg.rst index c3a74267..90b3062a 100644 --- a/doc/source/library/apt_pkg.rst +++ b/doc/source/library/apt_pkg.rst @@ -731,7 +731,7 @@ Index Files .. attribute:: index_files -.. class:: PackageIndexFile +.. class:: IndexFile .. method:: archive_uri(path) @@ -743,7 +743,7 @@ Index Files .. attribute:: describe - A description of the :class:`PackageIndexFile`. + A description of the :class:`IndexFile`. .. attribute:: exists @@ -1790,7 +1790,7 @@ Other classes .. method:: find_index(pkgfile) - Return a :class:`PackageIndexFile` object for the :class:`PackageFile` + Return a :class:`IndexFile` object for the :class:`PackageFile` *pkgfile*. .. method:: read_main_list diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 56594c61..df443c10 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -545,7 +545,7 @@ static struct _PyAptPkgAPIStruct API = { &PyMetaIndex_Type, // metaindex_type &PyPackage_Type, // package_type &PyPackageFile_Type, // packagefile_type - &PyPackageIndexFile_Type, // packageindexfile_type + &PyIndexFile_Type, // packageindexfile_type &PyPackageList_Type, // packagelist_type &PyPackageManager_Type, // packagemanager_type &PyPackageRecords_Type, // packagerecords_type @@ -638,7 +638,7 @@ extern "C" void initapt_pkg() ADDTYPE(Module,"DepCache",&PyDepCache_Type); ADDTYPE(Module,"ProblemResolver",&PyProblemResolver_Type); /* ========================= indexfile.cc ========================= */ - ADDTYPE(Module,"PackageIndexFile",&PyPackageIndexFile_Type); // NO __new__() + ADDTYPE(Module,"IndexFile",&PyIndexFile_Type); // NO __new__() /* ========================= metaindex.cc ========================= */ ADDTYPE(Module,"MetaIndex",&PyMetaIndex_Type); // NO __new__() /* ========================= pkgmanager.cc ========================= */ diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h index 97ba05a7..bc2f747b 100644 --- a/python/apt_pkgmodule.h +++ b/python/apt_pkgmodule.h @@ -103,7 +103,7 @@ extern PyTypeObject PySourceList_Type; PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args); // pkgSourceList -extern PyTypeObject PyPackageIndexFile_Type; +extern PyTypeObject PyIndexFile_Type; // metaIndex extern PyTypeObject PyMetaIndex_Type; diff --git a/python/indexfile.cc b/python/indexfile.cc index a6f8904e..7accaa50 100644 --- a/python/indexfile.cc +++ b/python/indexfile.cc @@ -15,7 +15,7 @@ #include -static PyObject *PackageIndexFileArchiveURI(PyObject *Self,PyObject *Args) +static PyObject *IndexFileArchiveURI(PyObject *Self,PyObject *Args) { pkgIndexFile *File = GetCpp(Self); char *path; @@ -25,38 +25,38 @@ static PyObject *PackageIndexFileArchiveURI(PyObject *Self,PyObject *Args) return HandleErrors(Safe_FromString(File->ArchiveURI(path).c_str())); } -static PyMethodDef PackageIndexFileMethods[] = +static PyMethodDef IndexFileMethods[] = { - {"archive_uri",PackageIndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, + {"archive_uri",IndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, #ifdef COMPAT_0_7 - {"ArchiveURI",PackageIndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, + {"ArchiveURI",IndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, #endif {} }; #define File (GetCpp(Self)) -static PyObject *PackageIndexFileGetLabel(PyObject *Self,void*) { +static PyObject *IndexFileGetLabel(PyObject *Self,void*) { return Safe_FromString(File->GetType()->Label); } -static PyObject *PackageIndexFileGetDescribe(PyObject *Self,void*) { +static PyObject *IndexFileGetDescribe(PyObject *Self,void*) { return Safe_FromString(File->Describe().c_str()); } -static PyObject *PackageIndexFileGetExists(PyObject *Self,void*) { +static PyObject *IndexFileGetExists(PyObject *Self,void*) { return Py_BuildValue("i",(File->Exists())); } -static PyObject *PackageIndexFileGetHasPackages(PyObject *Self,void*) { +static PyObject *IndexFileGetHasPackages(PyObject *Self,void*) { return Py_BuildValue("i",(File->HasPackages())); } -static PyObject *PackageIndexFileGetSize(PyObject *Self,void*) { +static PyObject *IndexFileGetSize(PyObject *Self,void*) { return Py_BuildValue("i",(File->Size())); } -static PyObject *PackageIndexFileGetIsTrusted(PyObject *Self,void*) { +static PyObject *IndexFileGetIsTrusted(PyObject *Self,void*) { return Py_BuildValue("i",(File->IsTrusted())); } #undef File #define S(x) (x ? x : "") -static PyObject *PackageIndexFileRepr(PyObject *Self) +static PyObject *IndexFileRepr(PyObject *Self) { pkgIndexFile *File = GetCpp(Self); return PyString_FromFormat("), // tp_basicsize 0, // tp_itemsize // Methods @@ -100,7 +100,7 @@ PyTypeObject PyPackageIndexFile_Type = 0, // tp_getattr 0, // tp_setattr 0, // tp_compare - PackageIndexFileRepr, // tp_repr + IndexFileRepr, // tp_repr 0, // tp_as_number 0, // tp_as_sequence 0, // tp_as_mapping @@ -118,9 +118,9 @@ PyTypeObject PyPackageIndexFile_Type = 0, // tp_weaklistoffset 0, // tp_iter 0, // tp_iternext - PackageIndexFileMethods, // tp_methods + IndexFileMethods, // tp_methods 0, // tp_members - PackageIndexFileGetSet, // tp_getset + IndexFileGetSet, // tp_getset }; diff --git a/python/metaindex.cc b/python/metaindex.cc index 4e059f0c..2c5b0bd9 100644 --- a/python/metaindex.cc +++ b/python/metaindex.cc @@ -38,7 +38,7 @@ static PyObject *MetaIndexGetIndexFiles(PyObject *Self,void*) { I != indexFiles->end(); I++) { CppOwnedPyObject *Obj; - Obj = CppOwnedPyObject_NEW(Self, &PyPackageIndexFile_Type,*I); + Obj = CppOwnedPyObject_NEW(Self, &PyIndexFile_Type,*I); // Do not delete pkgIndexFile*, they are managed by metaIndex. Obj->NoDelete = true; PyList_Append(List,Obj); diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index 086ec8d5..0b54c2fe 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -124,7 +124,7 @@ static PyObject *PkgSrcRecordsGetIndex(PyObject *Self,void*) { return 0; const pkgIndexFile &tmp = Struct.Last->Index(); CppOwnedPyObject *PyObj; - PyObj = CppOwnedPyObject_NEW(Self,&PyPackageIndexFile_Type, + PyObj = CppOwnedPyObject_NEW(Self,&PyIndexFile_Type, (pkgIndexFile*)&tmp); // Do not delete the pkgIndexFile*, it is managed by PkgSrcRecords::Parser. PyObj->NoDelete=true; diff --git a/python/python-apt.h b/python/python-apt.h index 08242c08..3e413dff 100644 --- a/python/python-apt.h +++ b/python/python-apt.h @@ -79,7 +79,7 @@ struct _PyAptPkgAPIStruct { # define PyMetaIndex_Type *(_PyAptPkg_API->metaindex_type) # define PyPackage_Type *(_PyAptPkg_API->package_type) # define PyPackageFile_Type *(_PyAptPkg_API->packagefile_type) -# define PyPackageIndexFile_Type *(_PyAptPkg_API->packageindexfile_type) +# define PyIndexFile_Type *(_PyAptPkg_API->packageindexfile_type) # define PyPackageList_Type *(_PyAptPkg_API->packagelist_type) # define PyPackageManager_Type *(_PyAptPkg_API->packagemanager_type) # define PyPackageRecords_Type *(_PyAptPkg_API->packagerecords_type) @@ -140,7 +140,7 @@ static int import_apt_pkg(void) { # define PyMetaIndex_Check(op) PyObject_TypeCheck(op, &PyMetaIndex_Type) # define PyPackage_Check(op) PyObject_TypeCheck(op, &PyPackage_Type) # define PyPackageFile_Check(op) PyObject_TypeCheck(op, &PyPackageFile_Type) -# define PyPackageIndexFile_Check(op) PyObject_TypeCheck(op, &PyPackageIndexFile_Type) +# define PyIndexFile_Check(op) PyObject_TypeCheck(op, &PyIndexFile_Type) # define PyPackageList_Check(op) PyObject_TypeCheck(op, &PyPackageList_Type) # define PyPackageManager_Check(op) PyObject_TypeCheck(op, &PyPackageManager_Type) # define PyPackageRecords_Check(op) PyObject_TypeCheck(op, &PyPackageRecords_Type) @@ -172,7 +172,7 @@ static int import_apt_pkg(void) { # define PyMetaIndex_CheckExact(op) (op->op_type == &PyMetaIndex_Type) # define PyPackage_CheckExact(op) (op->op_type == &PyPackage_Type) # define PyPackageFile_CheckExact(op) (op->op_type == &PyPackageFile_Type) -# define PyPackageIndexFile_CheckExact(op) (op->op_type == &PyPackageIndexFile_Type) +# define PyIndexFile_CheckExact(op) (op->op_type == &PyIndexFile_Type) # define PyPackageList_CheckExact(op) (op->op_type == &PyPackageList_Type) # define PyPackageManager_CheckExact(op) (op->op_type == &PyPackageManager_Type) # define PyPackageRecords_CheckExact(op) (op->op_type == &PyPackageRecords_Type) @@ -205,7 +205,7 @@ static int import_apt_pkg(void) { # define PyMetaIndex_ToCpp GetCpp # define PyPackage_ToCpp GetCpp # define PyPackageFile_ToCpp GetCpp -# define PyPackageIndexFile_ToCpp GetCpp +# define PyIndexFile_ToCpp GetCpp //# define PyPackageList_ToCpp GetCpp // NOT EXPORTED. # define PyPackageManager_ToCpp GetCpp //# define PyPackageRecords_ToCpp GetCpp // NOT EXPORTED @@ -256,7 +256,7 @@ inline CppOwnedPyObject *FromCppOwned(PyTypeObject *pytype, Cpp const &obj, # define PyIndexRecords_FromCpp(...) FromCpp(&PyIndexRecords_Type,##__VA_ARGS__) # define PyMetaIndex_FromCpp(...) FromCppOwned(&PyMetaIndex_Type,##__VA_ARGS__) # define PyPackage_FromCpp(...) FromCppOwned(&PyPackage_Type,##__VA_ARGS__) -# define PyPackageIndexFile_FromCpp(...) FromCppOwned(&PyPackageIndexFile_Type,##__VA_ARGS__) +# define PyIndexFile_FromCpp(...) FromCppOwned(&PyIndexFile_Type,##__VA_ARGS__) # define PyPackageFile_FromCpp(...) FromCppOwned(&PyPackageFile_Type,##__VA_ARGS__) //# define PyPackageList_FromCpp(...) FromCppOwned(&PyPackageList_Type,##__VA_ARGS__) # define PyPackageManager_FromCpp(...) FromCpp(&PyPackageManager_Type,##__VA_ARGS__) diff --git a/python/sourcelist.cc b/python/sourcelist.cc index e86f7fd3..52c0e6a8 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -35,13 +35,13 @@ static PyObject *PkgSourceListFindIndex(PyObject *Self,PyObject *Args) pkgIndexFile *index; if(list->FindIndex(i, index)) { - pyPkgIndexFile = CppOwnedPyObject_NEW(pyPkgFileIter,&PyPackageIndexFile_Type,index); + pyPkgIndexFile = CppOwnedPyObject_NEW(pyPkgFileIter,&PyIndexFile_Type,index); // Do not delete the pkgIndexFile*, it is managed by pkgSourceList. pyPkgIndexFile->NoDelete = true; return pyPkgIndexFile; } - //&PyPackageIndexFile_Type,&pyPkgIndexFile) + //&PyIndexFile_Type,&pyPkgIndexFile) Py_INCREF(Py_None); return Py_None; -- cgit v1.2.3 From 76b75e9acc4c1a85cc150efcdb55d446868002c8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 2 Feb 2010 17:59:43 +0100 Subject: doc/source/c++/api.rst: Update for the API changes. --- doc/source/c++/api.rst | 62 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'doc/source/c++') diff --git a/doc/source/c++/api.rst b/doc/source/c++/api.rst index 749e2bc0..e807f4bb 100644 --- a/doc/source/c++/api.rst +++ b/doc/source/c++/api.rst @@ -1,10 +1,10 @@ Python APT C++ API ================== The C++ API provides functions to create Python objects from C++ objects and -to retrieve the C++ object stored in the Python object. There are two types -of Python objects: owned ones and unowned ones. An owned object has another -Python object as its owner and keeps its owner alive for its lifetime. An -unowned object has no such owner. +to retrieve the C++ object stored in the Python object. An object may have +another Python object as its owner and keeps its owner alive for its +lifetime. Some objects require an owner of a specific type, while others +require none. Refer to the sections below for details. The C++ API names use the name of the class in apt_pkg and are prefixed with Py. For each supported class, there is a _Type object, a _Check() function, @@ -31,7 +31,7 @@ Acquire (pkgAcquire) Check that the object *object* is an :class:`apt_pkg.Acquire` object and no subclass thereof. -.. cfunction:: PyObject* PyAcquire_FromCpp(pkgAcquire *acquire, bool delete=false) +.. cfunction:: PyObject* PyAcquire_FromCpp(pkgAcquire *acquire, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Acquire` object from the :ctype:`pkgAcquire` pointer given by the parameter *acquire*. If the parameter *delete* is @@ -60,7 +60,7 @@ AcquireFile (pkgAcqFile) Check that the object *object* is an :class:`apt_pkg.AcquireFile` object and no subclass thereof. -.. cfunction:: PyObject* PyAcquireFile_FromCpp(pkgAcqFile *file, bool delete=false, PyObject *owner=NULL) +.. cfunction:: PyObject* PyAcquireFile_FromCpp(pkgAcqFile *file, bool delete, PyObject *owner) Create a new :class:`apt_pkg.AcquireFile` object from the :ctype:`pkgAcqFile` pointer given by the parameter *file*. If the parameter *delete* is @@ -89,7 +89,7 @@ AcquireItem (pkgAcquire::Item) Check that the object *object* is an :class:`apt_pkg.AcquireItem` object and no subclass thereof. -.. cfunction:: PyObject* PyAcquireItem_FromCpp(pkgAcquire::Item *item, bool delete=false, PyObject *owner=NULL) +.. cfunction:: PyObject* PyAcquireItem_FromCpp(pkgAcquire::Item *item, bool delete, PyObject *owner) Create a new :class:`apt_pkg.AcquireItem` object from the :ctype:`pkgAcquire::Item` pointer given by the parameter *item*. If the parameter *delete* is @@ -118,7 +118,7 @@ AcquireItemDesc (pkgAcquire::ItemDesc) Check that the object *object* is an :class:`apt_pkg.AcquireItemDesc` object and no subclass thereof. -.. cfunction:: PyObject* PyAcquireItemDesc_FromCpp(pkgAcquire::ItemDesc *desc, bool delete=false, PyObject *owner=NULL) +.. cfunction:: PyObject* PyAcquireItemDesc_FromCpp(pkgAcquire::ItemDesc *desc, bool delete, PyObject *owner) Create a new :class:`apt_pkg.AcquireItemDesc` object from the :ctype:`pkgAcquire::ItemDesc` pointer given by the parameter *desc*. If the parameter *delete* is @@ -147,7 +147,7 @@ AcquireWorker (pkgAcquire::Worker) Check that the object *object* is an :class:`apt_pkg.AcquireWorker` object and no subclass thereof. -.. cfunction:: PyObject* PyAcquireWorker_FromCpp(pkgAcquire::Worker *worker, bool delete=false, PyObject *owner=NULL) +.. cfunction:: PyObject* PyAcquireWorker_FromCpp(pkgAcquire::Worker *worker, bool delete, PyObject *owner) Create a new :class:`apt_pkg.AcquireWorker` object from the :ctype:`pkgAcquire::Worker` pointer given by the parameter *worker*. If the parameter *delete* is @@ -176,7 +176,7 @@ ActionGroup (pkgDepCache::ActionGroup) Check that the object *object* is an :class:`apt_pkg.ActionGroup` object and no subclass thereof. -.. cfunction:: PyObject* PyActionGroup_FromCpp(pkgDepCache::ActionGroup *agroup, bool delete=false, PyObject *owner=NULL) +.. cfunction:: PyObject* PyActionGroup_FromCpp(pkgDepCache::ActionGroup *agroup, bool delete, PyObject *owner) Create a new :class:`apt_pkg.ActionGroup` object from the :ctype:`pkgDepCache::ActionGroup` pointer given by the parameter *agroup*. If the parameter *delete* is @@ -205,7 +205,7 @@ Cache (pkgCache) Check that the object *object* is an :class:`apt_pkg.Cache` object and no subclass thereof. -.. cfunction:: PyObject* PyCache_FromCpp(pkgCache *cache, bool delete=false, PyObject *owner=NULL) +.. cfunction:: PyObject* PyCache_FromCpp(pkgCache *cache, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Cache` object from the :ctype:`pkgCache` pointer given by the parameter *cache*. If the parameter *delete* is @@ -236,7 +236,7 @@ CacheFile (pkgCacheFile) Check that the object *object* is of the type :cdata:`PyCacheFile_Type` and no subclass thereof. -.. cfunction:: PyObject* PyCacheFile_FromCpp(pkgCacheFile *file, bool delete=false) +.. cfunction:: PyObject* PyCacheFile_FromCpp(pkgCacheFile *file, bool delete, PyObject *owner) Create a new :class:`apt_pkg.CacheFile` object from the :ctype:`pkgCacheFile` pointer given by the parameter *file* If the parameter *delete* is @@ -264,7 +264,7 @@ Cdrom (pkgCdrom) Check that the object *object* is an :class:`apt_pkg.Cdrom` object and no subclass thereof. -.. cfunction:: PyObject* PyCdrom_FromCpp(pkgCdrom &cdrom, bool delete=false) +.. cfunction:: PyObject* PyCdrom_FromCpp(pkgCdrom &cdrom, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Cdrom` object from the :ctype:`pkgCdrom` reference given by the parameter *cdrom*. If the parameter *delete* is @@ -292,7 +292,7 @@ Configuration (Configuration) Check that the object *object* is an :class:`apt_pkg.Configuration` object and no subclass thereof. -.. cfunction:: PyObject* PyConfiguration_FromCpp(Configuration *cpp, bool delete=false, PyObject *owner=null) +.. cfunction:: PyObject* PyConfiguration_FromCpp(Configuration *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Configuration` object from the :ctype:`Configuration` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -321,7 +321,7 @@ DepCache (pkgDepCache) Check that the object *object* is an :class:`apt_pkg.DepCache` object and no subclass thereof. -.. cfunction:: PyObject* PyDepCache_FromCpp(pkgDepCache *cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyDepCache_FromCpp(pkgDepCache *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.DepCache` object from the :ctype:`pkgDepCache` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -350,7 +350,7 @@ Dependency (pkgCache::DepIterator) Check that the object *object* is an :class:`apt_pkg.Dependency` object and no subclass thereof. -.. cfunction:: PyObject* PyDependency_FromCpp(pkgCache::DepIterator &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyDependency_FromCpp(pkgCache::DepIterator &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Dependency` object from the :ctype:`pkgCache::DepIterator` reference given by the parameter *cpp*. If the parameter *delete* is @@ -379,7 +379,7 @@ Description (pkgCache::DescIterator) Check that the object *object* is an :class:`apt_pkg.Description` object and no subclass thereof. -.. cfunction:: PyObject* PyDescription_FromCpp(pkgCache::DescIterator &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyDescription_FromCpp(pkgCache::DescIterator &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Description` object from the :ctype:`pkgCache::DescIterator` reference given by the parameter *cpp*. If the parameter *delete* is @@ -408,7 +408,7 @@ Hashes (Hashes) Check that the object *object* is an :class:`apt_pkg.Hashes` object and no subclass thereof. -.. cfunction:: PyObject* PyHashes_FromCpp(Hashes &cpp, bool delete=false) +.. cfunction:: PyObject* PyHashes_FromCpp(Hashes &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Hashes` object from the :ctype:`Hashes` reference given by the parameter *cpp*. If the parameter *delete* is @@ -436,7 +436,7 @@ HashString (HashString) Check that the object *object* is an :class:`apt_pkg.HashString` object and no subclass thereof. -.. cfunction:: PyObject* PyHashString_FromCpp(HashString *cpp, bool delete=false) +.. cfunction:: PyObject* PyHashString_FromCpp(HashString *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.HashString` object from the :ctype:`HashString` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -464,7 +464,7 @@ IndexRecords (indexRecords) Check that the object *object* is an :class:`apt_pkg.IndexRecords` object and no subclass thereof. -.. cfunction:: PyObject* PyIndexRecords_FromCpp(indexRecords *cpp, bool delete=false) +.. cfunction:: PyObject* PyIndexRecords_FromCpp(indexRecords *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.IndexRecords` object from the :ctype:`indexRecords` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -493,7 +493,7 @@ MetaIndex (metaIndex) Check that the object *object* is an :class:`apt_pkg.MetaIndex` object and no subclass thereof. -.. cfunction:: PyObject* PyMetaIndex_FromCpp(metaIndex *cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyMetaIndex_FromCpp(metaIndex *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.MetaIndex` object from the :ctype:`metaIndex` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -522,7 +522,7 @@ Package (pkgCache::PkgIterator) Check that the object *object* is an :class:`apt_pkg.Package` object and no subclass thereof. -.. cfunction:: PyObject* PyPackage_FromCpp(pkgCache::PkgIterator &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyPackage_FromCpp(pkgCache::PkgIterator &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Package` object from the :ctype:`pkgCache::PkgIterator` reference given by the parameter *cpp*. If the parameter *delete* is @@ -551,7 +551,7 @@ PackageFile (pkgCache::PkgFileIterator) Check that the object *object* is an :class:`apt_pkg.PackageFile` object and no subclass thereof. -.. cfunction:: PyObject* PyPackageFile_FromCpp(pkgCache::PkgFileIterator &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyPackageFile_FromCpp(pkgCache::PkgFileIterator &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.PackageFile` object from the :ctype:`pkgCache::PkgFileIterator` reference given by the parameter *cpp*. If the parameter *delete* is @@ -580,7 +580,7 @@ IndexFile (pkgIndexFile) Check that the object *object* is an :class:`apt_pkg.IndexFile` object and no subclass thereof. -.. cfunction:: PyObject* PyIndexFile_FromCpp(pkgIndexFile *cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyIndexFile_FromCpp(pkgIndexFile *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.IndexFile` object from the :ctype:`pkgIndexFile` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -610,7 +610,7 @@ PackageManager (pkgPackageManager) Check that the object *object* is an :class:`apt_pkg.PackageManager` object and no subclass thereof. -.. cfunction:: PyObject* PyPackageManager_FromCpp(pkgPackageManager *cpp, bool delete=false) +.. cfunction:: PyObject* PyPackageManager_FromCpp(pkgPackageManager *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.PackageManager` object from the :ctype:`pkgPackageManager` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -639,7 +639,7 @@ Policy (pkgPolicy) Check that the object *object* is an :class:`apt_pkg.Policy` object and no subclass thereof. -.. cfunction:: PyObject* PyPolicy_FromCpp(pkgPolicy *cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyPolicy_FromCpp(pkgPolicy *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Policy` object from the :ctype:`pkgPolicy` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -669,7 +669,7 @@ ProblemResolver (pkgProblemResolver) Check that the object *object* is an :class:`apt_pkg.ProblemResolver` object and no subclass thereof. -.. cfunction:: PyObject* PyProblemResolver_FromCpp(pkgProblemResolver *cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyProblemResolver_FromCpp(pkgProblemResolver *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.ProblemResolver` object from the :ctype:`pkgProblemResolver` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -700,7 +700,7 @@ SourceList (pkgSourceList) Check that the object *object* is an :class:`apt_pkg.SourceList` object and no subclass thereof. -.. cfunction:: PyObject* PySourceList_FromCpp(pkgSourceList *cpp, bool delete=false) +.. cfunction:: PyObject* PySourceList_FromCpp(pkgSourceList *cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.SourceList` object from the :ctype:`pkgSourceList` pointer given by the parameter *cpp*. If the parameter *delete* is @@ -729,7 +729,7 @@ TagFile (pkgTagFile) Check that the object *object* is an :class:`apt_pkg.TagFile` object and no subclass thereof. -.. cfunction:: PyObject* PyTagFile_FromCpp(pkgTagFile &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyTagFile_FromCpp(pkgTagFile &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.TagFile` object from the :ctype:`pkgTagFile` reference given by the parameter *cpp*. If the parameter *delete* is @@ -758,7 +758,7 @@ TagSection (pkgTagSection) Check that the object *object* is an :class:`apt_pkg.TagSection` object and no subclass thereof. -.. cfunction:: PyObject* PyTagSection_FromCpp(pkgTagSection &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyTagSection_FromCpp(pkgTagSection &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.TagSection` object from the :ctype:`pkgTagSection` reference given by the parameter *cpp*. If the parameter *delete* is @@ -787,7 +787,7 @@ Version (pkgCache::VerIterator) Check that the object *object* is an :class:`apt_pkg.Version` object and no subclass thereof. -.. cfunction:: PyObject* PyVersion_FromCpp(pkgCache::VerIterator &cpp, bool delete=false, PyObject *owner) +.. cfunction:: PyObject* PyVersion_FromCpp(pkgCache::VerIterator &cpp, bool delete, PyObject *owner) Create a new :class:`apt_pkg.Version` object from the :ctype:`pkgCache::VerIterator` reference given by the parameter *cpp*. If the parameter *delete* is -- cgit v1.2.3