diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-03-23 18:57:27 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-03-23 18:57:27 +0100 |
| commit | 36a56f0d7b810858145b1058c72f51eaa76d0d76 (patch) | |
| tree | d85d9291a16cd9726a6d502e2681896171912ccb /python/python-apt.h | |
| parent | 2aa709e41d8896ef897863ea9181c409c4c87a8c (diff) | |
| parent | 73eff261f0c50609b3cee3ff099b1891d4c909f3 (diff) | |
| download | python-apt-36a56f0d7b810858145b1058c72f51eaa76d0d76.tar.gz | |
Updated to the 0.7.9x series (FFe LP: #531518)
[ Julian Andres Klode ]
* python/generic.cc:
- Fix a memory leak when using old attribute names.
* debian/control:
- Change priority to standard, keep -doc and -dev on optional.
[ Michael Vogt ]
* apt/cache.py:
- make cache open silent by default (use apt.progress.base.OpProgress)
* tests/data/aptsources_ports/sources.list:
- fix ports test-data
* debian/control
- build against XS-Python-Versions: 2.6, 3.1
* tests/test_apt_cache.py:
- add simple test for basic cache/dependency iteration
* apt/__init__.py:
- only show deprecation warnings if PYTHON_APT_DEPRECATION_WARNINGS
is set in the environment. While we do want to have the new API its
not feasible to port all apps in the lucid timeframe. Once lucid
is released we turn the warnings on by default again
* Revert 0.7.93.3 and just set APT::Architecture to i386 for
test_aptsources; fixes FTBFS on powerpc.
* Pass --exclude=migrate-0.8.py to dh_pycentral; in order to not depend
on python2.6; but recommend python2.6.
* Use dh_link instead of ln for python-apt-doc (Closes: #573523).
* Pass --link-doc=python-apt to dh_installdocs.
* Install examples to python-apt-doc instead of python-apt.
* tests/test_all.py: Write information header to stderr, not stdout.
* Build documentation only when needed (when building python-apt-doc).
* Move documentation into python-apt-doc (Closes: #572617)
* Build documentation only once on the default Python version.
* python/acquire-item.cc:
- Add AcquireItem.partialsize member.
* python/apt_pkgmodule.cc:
- Treat '>>' and '>', '<<' and '<' as identical in check_dep (LP: #535667).
* python/generic.cc:
- Map UntranslatedDepType to dep_type_untranslated.
* python/tag.cc:
- Hack the TagFile iterator to not use shared storage (Closes: #572596):
Scan once, duplicate the section data, and scan again.
* apt/package.py:
- Create a string class BaseDependency.__dstr which makes '>' equal to
'>>' and '<' equal to '<<' (compatibility).
- Use the binary package version in Version.fetch_source() if the
source version is not specified (i.e. in the normal case).
- Always return unicode strings in Package.get_changelog (Closes: #572998).
* apt/progress/text.py:
- Drop InstallProgress, it's useless to keep this alias around.
* apt/progress/old.py:
- Let the new method call the old one; e.g. status_update() now calls
self.statusUpdate(). This improves compatibility for sub classes.
* Merge with Ubuntu:
- util/get_ubuntu_mirrors_from_lp.py:
+ rewritten to use +archivemirrors-rss and feedburner
- pre-build.sh: update ubuntu mirrors on bzr-buildpackage (and also do this
for Debian mirrors)
- add break for packagekit-backend-apt (<= 0.4.8-0ubuntu4)
* tests:
- test_deps: Add tests for apt_pkg.CheckDep, apt_pkg.check_dep,
apt_pkg.parse_depends and apt_pkg.parse_src_depends.
* tests/data/aptsources/sources.list.testDistribution:
- change one mirror which is not on the mirror list anymore.
* utils/get_debian_mirrors.py:
- Parse Mirrors.masterlist instead of the HTML web page.
* utils/get_ubuntu_mirrors_from_lp.py:
- Sort the mirror list of each country.
- Use generic MirrorsFile key instead of per-architecture ones in
order to fix FTBFS on !amd64 !i386 (Closes: #571752)
[ Julian Andres Klode ]
* Fix some places where the old API was still used:
- apt/utils.py: Completely ported, previous one was old-API from Ubuntu.
- apt/cache.py: Use the new progress classes instead of the old ones.
- apt/package.py: Various smaller issues fixed, probably caused by merge.
* utils/migrate-0.8.py:
- Improve C++ parsing and add apt.progress.old to the modules, reduces
false positives.
- Ship the list of deprecated things in the apt_pkg and apt_inst modules
inside the script itself, so we don't have to parse the source code
anymore.
* python:
- Handle deprecated attributes and methods in the tp_gettattro slot, this
allows us to easily warn if a deprecated function is used.
* python/tagfile.cc:
- Implement the iterator protocol in TagFile.
* python/cache.cc:
- Implement Cache.__len__() and Cache.__contains__() (Closes: #571443).
* data/templates/Debian.info.in:
- Replace the MatchURI with one that really matches something.
* aptsources/distro.py:
- Call lsb_release with -idrc instead of --all.
* tests:
- Fix aptsources tests to use local data files if available.
- test_all.py: Use local modules instead of system ones if possible.
* data/templates/*.in: Switch MirrorsFile to relative filenames.
- setup.py: Copy the mirror lists to the build directory
- aptsources/distinfo.py: Support relative filenames for MirrorsFile.
* debian/rules:
- Run tests during build time.
* debian/python-apt.install:
- Install utils/migrate-0.8.py to /usr/share/python-apt/.
[ Michael Vogt ]
* apt/cache.py:
- call install_progress.startUpdate()/finishUpdate() to keep
compatibility with older code
* apt/progress/base.py:
- restore "self.statusfd, self.writefd" type, provide additional
self.status_stream and self.write_stream file like objects
* python/progress.cc:
- try to call compatibility functions first, then new functions
[ Julian Andres Klode ]
* Fix reference counting for old progress classes (Closes: #566370).
* apt/cache.py:
- Fix Cache.update() to not raise errors on successful updates.
* python/progress.cc:
- Fix some threading issues (add some missing PyCbObj_BEGIN_ALLOW_THREADS)
* python/acquire-item.cc:
- Support items without an owner set.
* python/tarfile.cc:
- When extracting, only allocate a new buffer if the old one was too small.
- Do not segfault if TarFile.go() is called without a member name.
- Clone all pkgDirStream::Item's so apt_pkg.TarMember object can be used
outside of the callback function passed to go().
- If only one member is requested, extract just that one.
* Drop the segfault prevention measures from the Acquire code, as they fail
to work. A replacement will be added once destruction callbacks are added
in APT.
* Merge the CppOwnedPyObject C++ class into CppPyObject.
* Remove inline functions from the C++ API, export them instead.
* Localization
- de.po: Update against new template
* python/arfile.cc:
- Handle the case where ararchive_new returns NULL in debfile_new.
* apt/progress/base.py:
- select.error objects do not have an errno attribute (Closes: #568005)
* doc/client-example.cc: Update against the new API.
* Fix typos of separated in multiple files (reported by lintian).
* debian/control:
- Make python-apt-dev depend on ${misc:Depends} and recommend python-dev.
- Set Standards-Version to 3.8.4.
[ Michael Vogt ]
[ Julian Andres Klode ]
* Merge debian-sid and debian-experimental.
* Add a tutorial on how to do things which are possible with apt-get,
like apt-get --print-uris update (cf. #551164).
* Build for Python 2.5, 2.6 and 3.1; 2.6 and 3.1 hit unstable on Jan 16.
- Use DH_PYCENTRAL=nomove for now because include-links seems broken
* Merge lp:~forest-bond/python-apt/cache-is-virtual-package-catch-key-error
- Return False in Cache.is_virtual_package if the package does not exist.
* Make all class-level constants have uppercase names.
* Rewrite apt.progress.gtk2 documentation by hand and drop python-gtk2
build-time dependency.
* aptsources:
- Make all classes subclasses of object.
- distro.py: Support Python 3, decode lsb_release results using utf-8.
* apt/progress/base.py:
- 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:
- Fix InstallProgress.updateInterface() to cope with read() returning 0
on non-blocking file descriptors (LP: #491027).
* New features:
- Provide a C++ API in the package python-apt-dev (Closes: #334923).
- Add apt_pkg.HashString and apt_pkg.IndexRecords (Closes: #456141).
- Add apt_pkg.Policy class (Closes: #382725).
- Add apt_pkg.Hashes class.
- Allow types providing __new__() to be subclassed.
- Add apt_pkg.DepCache.mark_auto() and apt.Package.mark_auto() methods to
mark a package as automatically installed.
- Make AcquireFile a subclass of AcquireItem, thus inheriting attributes.
- New progress handling in apt.progress.base and apt.progress.text. Still
missing Qt4 progress handlers.
- Classes in apt_inst (Closes: #536096)
+ You can now use apt_inst.DebFile.data to access the data.tar.* member
regardless of its compression (LP: #44493)
* Unification of dependency handling:
- apt_pkg.parse_[src_]depends() now use CompType instead of CompTypeDeb
(i.e. < instead of <<) to match the interface of Version.depends_list_str
- apt_pkg.SourceRecords.build_depends matches exactly the interface of
Version.depends_list_str just with different keys (e.g. Build-Depends).
+ Closes: #468123 - there is no need anymore for binding CompType or
CompTypeDeb, because we don't return integer values for CompType
anymore.
* Bugfixes:
- Delete pointers correctly, fixing memory leaks (LP: #370149).
- Drop open() and close() in apt_pkg.Cache as they cause segfaults.
- Raise ValueError in AcquireItem if the Acquire process is shut down
instead of segfaulting.
* Other stuff:
- Merge releases 0.7.10.4 - 0.7.12.1 from unstable.
- Merge Configuration,ConfigurationPtr,ConfigurationSub into one type.
- Simplify the whole build process by using a single setup.py.
- The documentation has been restructured and enhanced with tutorials.
- Only recommend lsb-release instead of depending on it. Default to
Debian unstable if lsb_release is not available.
[ Julian Andres Klode ]
* Rename where needed according to PEP 8 conventions (Closes: #481061)
* Where possible, derive apt.package.Record from collections.Mapping.
* ActionGroups can be used as a context manager for the 'with' statement.
* utils/migrate-0.8.py: Helper to check Python code for deprecated functions,
attributes,etc. Has to be run from the python-apt source tree, but can be
used for all Python code using python-apt.
* debian/control: Only recommend libjs-jquery (Closes: #527543).
[ Stefano Zacchiroli ]
* debian/python-apt.doc-base: register the documentation with the
doc-base system (Closes: #525134)
[ Sebastian Heinlein ]
* apt/package.py: Add Package.get_version() which returns a Version instance
for the given version string or None (Closes: #523998)
* Introduce support for Python 3 (Closes: #523645)
* Support the 'in' operator (e.g. "k in d") in Configuration{,Ptr,Sub}
objects (e.g. apt_pkg.Config) and in TagSections (apt_pkg.ParseSection())
* Replace support for file objects with a more generic support for any object
providing a fileno() method and for file descriptors (integers).
* Add support for the Breaks fields
* Only create Package objects when they are requested, do not keep them in
a dict. Saves 10MB for 25,000 packages on my machine.
* apt/package.py: Allow to set the candidate of a package (Closes: #523997)
- Support assignments to the 'candidate' property of Package objects.
- Initial patch by Sebastian Heinlein
[ Michael Vogt ]
* data/templates/Ubuntu.info.in:
- make armel point to ports.ubuntu.com (LP: #531876)
[ Emmet Hikory ]
* data/templates/Ubuntu.info.in:
- refactor to use ports by default for gutsy and newer releases
- Set appropriate exceptions to defaults for warty-lucid
* Drop build dependency on python2.4.
* apt/utils.py:
- add some misc utils like get_release_filename_for_pkg()
[ Michael Vogt ]
* apt/cache.py:
- improved docstring for the cache
- add "enhances" property
* data/templates/Ubuntu.info.in:
- add lucid
* python/cache.cc:
- add UntranslatedDepType attribute to DependencyType
- add DepTypeEnum that returns a value from
{DepDepends, DepPreDepends, ...}
* python/apt_pkgmodule.cc:
- add DepDpkgBreaks, DepEnhances constants
* doc/source/apt_pkg/{cache.rst, index.rst}:
- update documentation as well
* Fix FTBFS with python-debian (>= 0.1.13) on Python 2.4 by not using it to
get a version number in setup.py (Closes: #523473)
* apt/package.py:
- (Package.candidateRecord): Fix missing 'd' in 'record'
- (DeprecatedProperty.__get__): Only warn when used on objects, this
makes it easier to use e.g. pydoc,sphinx,pychecker.
* Merged python-apt consolidation branch by Sebastian
Heinlein (many thanks)
* apt/cache.py:
- new method "isVirtualPackage()"
- new method "getProvidingPackages()"
- new method "getRequiredDownload()"
- new method "additionalRequiredSpace()"
* apt/debfile.py:
- move a lot of the gdebi code into this file, this
provides interfaces for querrying and installing
.deb files and .dsc files
* apt/package.py:
- better description parsing
- new method "installedFiles()"
- new method "getChangelog()"
* apt/gtk/widgets.py:
- new gobject GOpProgress
- new gobject GFetchProgress
- new gobject GInstallProgress
- new gobject GDpkgInstallProgress
- new widget GtkAptProgress
* doc/examples/gui-inst.py:
- updated to use the new widgets
* debian/control:
- add suggests for python-gtk2 and python-vte
* setup.py:
- build html/ help of the apt and aptsources modules
into /usr/share/doc/python-apt/html
* apt/__init__.py:
- remove the future warning
* Non-maintainer upload.
* data/templates/Debian.info.in: Set the BaseURI to security.debian.org for
lenny/updates, etch/updates and sarge/updates. (Closes: #503237)
* data/templates/Debian.info.in:
- add 'lenny' template info (closes: #476364)
* aptsources/distinfo.py:
- fix template matching for arch specific code (LP: #244093)
Diffstat (limited to 'python/python-apt.h')
| -rw-r--r-- | python/python-apt.h | 347 |
1 files changed, 347 insertions, 0 deletions
diff --git a/python/python-apt.h b/python/python-apt.h new file mode 100644 index 00000000..b9fc9212 --- /dev/null +++ b/python/python-apt.h @@ -0,0 +1,347 @@ +/* + * python-apt.h - Header file for the public interface. + * + * Copyright 2009-2010 Julian Andres Klode <jak@debian.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#ifndef PYTHON_APT_H +#define PYTHON_APT_H +#include <Python.h> +#include "generic.h" +#include <apt-pkg/configuration.h> +#include <apt-pkg/acquire-item.h> +#include <apt-pkg/packagemanager.h> +#include <apt-pkg/version.h> +#include <apt-pkg/deblistparser.h> +#include <apt-pkg/pkgcache.h> +#include <apt-pkg/cachefile.h> +#include <apt-pkg/tagfile.h> +#include <apt-pkg/init.h> +#include <apt-pkg/pkgsystem.h> +#include <apt-pkg/cdrom.h> +#include <apt-pkg/algorithms.h> +#include <apt-pkg/hashes.h> + +typedef PyObject *ActionGroupF(pkgDepCache::ActionGroup *); +typedef pkgDepCache::ActionGroup*& ActionGroupT(PyObject *self); + +struct _PyAptPkgAPIStruct { + // apt_pkg.Acquire (pkgAcquire*) + PyTypeObject *acquire_type; + PyObject* (*acquire_fromcpp)(pkgAcquire *acquire, bool Delete, PyObject*); + pkgAcquire*& (*acquire_tocpp)(PyObject *self); + // apt_pkg.AcquireFile + PyTypeObject *acquirefile_type; + PyObject* (*acquirefile_fromcpp)(pkgAcqFile* const &obj, bool Delete, PyObject *Owner); + pkgAcqFile*& (*acquirefile_tocpp)(PyObject *self); + + // apt_pkg.AcquireItem + PyTypeObject *acquireitem_type; + PyObject* (*acquireitem_fromcpp)(pkgAcquire::Item* const &obj, bool Delete, PyObject *Owner); + pkgAcquire::Item*& (*acquireitem_tocpp)(PyObject *self); + // apt_pkg.AcquireItemDesc + PyTypeObject *acquireitemdesc_type; + PyObject* (*acquireitemdesc_fromcpp)(pkgAcquire::ItemDesc* const &obj, bool Delete, PyObject *Owner); + pkgAcquire::ItemDesc*& (*acquireitemdesc_tocpp)(PyObject *self); + + PyTypeObject *acquireworker_type; + PyObject* (*acquireworker_fromcpp)(pkgAcquire::Worker* const &obj, bool Delete, PyObject *Owner); + pkgAcquire::Worker*& (*acquireworker_tocpp)(PyObject *self); + + PyTypeObject *actiongroup_type; + PyObject* (*actiongroup_fromcpp)(pkgDepCache::ActionGroup* const &obj, bool Delete, PyObject *Owner); + pkgDepCache::ActionGroup*& (*actiongroup_tocpp)(PyObject *self); + + PyTypeObject *cache_type; + PyObject* (*cache_fromcpp)(pkgCache* const &obj, bool Delete, PyObject *Owner); + pkgCache*& (*cache_tocpp)(PyObject *self); + + PyTypeObject *cachefile_type; + PyObject* (*cachefile_fromcpp)(pkgCacheFile* const &obj, bool Delete, PyObject *Owner); + pkgCacheFile*& (*cachefile_tocpp)(PyObject *self); + + PyTypeObject *cdrom_type; + PyObject* (*cdrom_fromcpp)(pkgCdrom const &obj, bool Delete, PyObject *Owner); + pkgCdrom& (*cdrom_tocpp)(PyObject *self); + + PyTypeObject *configuration_type; + PyObject* (*configuration_fromcpp)(Configuration* const &obj, bool Delete, PyObject *Owner); + Configuration*& (*configuration_tocpp)(PyObject *self); + + PyTypeObject *depcache_type; + PyObject* (*depcache_fromcpp)(pkgDepCache* const &obj, bool Delete, PyObject *Owner); + pkgDepCache*& (*depcache_tocpp)(PyObject *self); + + PyTypeObject *dependency_type; + PyObject* (*dependency_fromcpp)(pkgCache::DepIterator const &obj, bool Delete, PyObject *Owner); + pkgCache::DepIterator& (*dependency_tocpp)(PyObject *self); + + PyTypeObject *dependencylist_type; + void *dependencylist_fromcpp; // FIXME: need dependencylist_fromcpp + void *dependencylist_tocpp; // FIXME: need dependencylist_tocpp + + PyTypeObject *description_type; + PyObject* (*description_fromcpp)(pkgCache::DescIterator const &obj, bool Delete, PyObject *Owner); + pkgCache::DescIterator& (*description_tocpp)(PyObject *self); + + PyTypeObject *hashes_type; + PyObject* (*hashes_fromcpp)(Hashes const &obj, bool Delete, PyObject *Owner); + Hashes& (*hashes_tocpp)(PyObject *self); + + PyTypeObject *hashstring_type; + PyObject* (*hashstring_fromcpp)(HashString* const &obj, bool Delete, PyObject *Owner); + HashString*& (*hashstring_tocpp)(PyObject *self); + + PyTypeObject *indexrecords_type; + PyObject* (*indexrecords_fromcpp)(indexRecords* const &obj, bool Delete, PyObject *Owner); + indexRecords*& (*indexrecords_tocpp)(PyObject *self); + + PyTypeObject *metaindex_type; + PyObject* (*metaindex_fromcpp)(metaIndex* const &obj, bool Delete, PyObject *Owner); + metaIndex*& (*metaindex_tocpp)(PyObject *self); + + PyTypeObject *package_type; + PyObject* (*package_fromcpp)(pkgCache::PkgIterator const &obj, bool Delete, PyObject *Owner); + pkgCache::PkgIterator& (*package_tocpp)(PyObject *self); + + PyTypeObject *packagefile_type; + PyObject* (*packagefile_fromcpp)(pkgCache::PkgFileIterator const &obj, bool Delete, PyObject *Owner); + pkgCache::PkgFileIterator& (*packagefile_tocpp)(PyObject *self); + + PyTypeObject *packageindexfile_type; + PyObject* (*indexfile_fromcpp)(pkgIndexFile* const &obj, bool Delete, PyObject *Owner); + pkgIndexFile*& (*packageindexfile_tocpp)(PyObject *self); + + PyTypeObject *packagelist_type; + void *packagelist_fromcpp; // FIXME: need packagelist_fromcpp + void *packagelist_tocpp; // FIXME: need packagelist_tocpp + + PyTypeObject *packagemanager_type; + PyObject* (*packagemanager_fromcpp)(pkgPackageManager* const &obj, bool Delete, PyObject *Owner); + pkgPackageManager*& (*packagemanager_tocpp)(PyObject *self); + + PyTypeObject *packagerecords_type; + void *packagerecords_fromcpp; // FIXME: need packagerecords_fromcpp + void *packagerecords_tocpp; // FIXME: need packagerecords_tocpp + + PyTypeObject *policy_type; + PyObject* (*policy_fromcpp)(pkgPolicy* const &obj, bool Delete, PyObject *Owner); + pkgPolicy*& (*policy_tocpp)(PyObject *self); + + PyTypeObject *problemresolver_type; + PyObject* (*problemresolver_fromcpp)(pkgProblemResolver* const &obj, bool Delete, PyObject *Owner); + pkgProblemResolver*& (*problemresolver_tocpp)(PyObject *self); + + PyTypeObject *sourcelist_type; + PyObject* (*sourcelist_fromcpp)(pkgSourceList* const &obj, bool Delete, PyObject *Owner); + pkgSourceList*& (*sourcelist_tocpp)(PyObject *self); + + PyTypeObject *sourcerecords_type; + void *sourcerecords_fromcpp; // FIXME: need sourcerecords_fromcpp + void *sourcerecords_tocpp; // FIXME: need sourcerecords_tocpp + + PyTypeObject *tagfile_type; + PyObject* (*tagfile_fromcpp)(pkgTagFile const &obj, bool Delete, PyObject *Owner); + pkgTagFile& (*tagfile_tocpp)(PyObject *self); + + PyTypeObject *tagsection_type; + PyObject* (*tagsection_fromcpp)(pkgTagSection const &obj, bool Delete, PyObject *Owner); + pkgTagSection& (*tagsection_tocpp)(PyObject *self); + + PyTypeObject *version_type; + PyObject* (*version_fromcpp)(pkgCache::VerIterator const &obj, bool Delete, PyObject *Owner); + pkgCache::VerIterator& (*version_tocpp)(PyObject *self); + +}; + +// Checking macros. +# define PyAcquire_Check(op) PyObject_TypeCheck(op, &PyAcquire_Type) +# define PyAcquireFile_Check(op) PyObject_TypeCheck(op, &PyAcquireFile_Type) +# define PyAcquireItem_Check(op) PyObject_TypeCheck(op, &PyAcquireItem_Type) +# define PyAcquireItemDesc_Check(op) PyObject_TypeCheck(op, &PyAcquireItemDesc_Type) +# define PyAcquireWorker_Check(op) PyObject_TypeCheck(op, &PyAcquireWorker_Type) +# define PyActionGroup_Check(op) PyObject_TypeCheck(op, &PyActionGroup_Type) +# define PyCache_Check(op) PyObject_TypeCheck(op, &PyCache_Type) +# define PyCacheFile_Check(op) PyObject_TypeCheck(op, &PyCacheFile_Type) +# define PyCdrom_Check(op) PyObject_TypeCheck(op, &PyCdrom_Type) +# define PyConfiguration_Check(op) PyObject_TypeCheck(op, &PyConfiguration_Type) +# define PyDepCache_Check(op) PyObject_TypeCheck(op, &PyDepCache_Type) +# define PyDependency_Check(op) PyObject_TypeCheck(op, &PyDependency_Type) +# define PyDependencyList_Check(op) PyObject_TypeCheck(op, &PyDependencyList_Type) +# define PyDescription_Check(op) PyObject_TypeCheck(op, &PyDescription_Type) +# define PyHashes_Check(op) PyObject_TypeCheck(op, &PyHashes_Type) +# define PyHashString_Check(op) PyObject_TypeCheck(op, &PyHashString_Type) +# define PyIndexRecords_Check(op) PyObject_TypeCheck(op, &PyIndexRecords_Type) +# 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 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) +# define PyPolicy_Check(op) PyObject_TypeCheck(op, &PyPolicy_Type) +# define PyProblemResolver_Check(op) PyObject_TypeCheck(op, &PyProblemResolver_Type) +# define PySourceList_Check(op) PyObject_TypeCheck(op, &PySourceList_Type) +# define PySourceRecords_Check(op) PyObject_TypeCheck(op, &PySourceRecords_Type) +# define PyTagFile_Check(op) PyObject_TypeCheck(op, &PyTagFile_Type) +# define PyTagSection_Check(op) PyObject_TypeCheck(op, &PyTagSection_Type) +# define PyVersion_Check(op) PyObject_TypeCheck(op, &PyVersion_Type) +// Exact check macros. +# define PyAcquire_CheckExact(op) (op->op_type == &PyAcquire_Type) +# define PyAcquireFile_CheckExact(op) (op->op_type == &PyAcquireFile_Type) +# define PyAcquireItem_CheckExact(op) (op->op_type == &PyAcquireItem_Type) +# define PyAcquireItemDesc_CheckExact(op) (op->op_type == &PyAcquireItemDesc_Type) +# define PyAcquireWorker_CheckExact(op) (op->op_type == &PyAcquireWorker_Type) +# define PyActionGroup_CheckExact(op) (op->op_type == &PyActionGroup_Type) +# define PyCache_CheckExact(op) (op->op_type == &PyCache_Type) +# define PyCacheFile_CheckExact(op) (op->op_type == &PyCacheFile_Type) +# define PyCdrom_CheckExact(op) (op->op_type == &PyCdrom_Type) +# define PyConfiguration_CheckExact(op) (op->op_type == &PyConfiguration_Type) +# define PyDepCache_CheckExact(op) (op->op_type == &PyDepCache_Type) +# define PyDependency_CheckExact(op) (op->op_type == &PyDependency_Type) +# define PyDependencyList_CheckExact(op) (op->op_type == &PyDependencyList_Type) +# define PyDescription_CheckExact(op) (op->op_type == &PyDescription_Type) +# define PyHashes_CheckExact(op) (op->op_type == &PyHashes_Type) +# define PyHashString_CheckExact(op) (op->op_type == &PyHashString_Type) +# define PyIndexRecords_CheckExact(op) (op->op_type == &PyIndexRecords_Type) +# 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 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) +# define PyPolicy_CheckExact(op) (op->op_type == &PyPolicy_Type) +# define PyProblemResolver_CheckExact(op) (op->op_type == &PyProblemResolver_Type) +# define PySourceList_CheckExact(op) (op->op_type == &PySourceList_Type) +# define PySourceRecords_CheckExact(op) (op->op_type == &PySourceRecords_Type) +# define PyTagFile_CheckExact(op) (op->op_type == &PyTagFile_Type) +# define PyTagSection_CheckExact(op) (op->op_type == &PyTagSection_Type) +# define PyVersion_CheckExact(op) (op->op_type == &PyVersion_Type) + +# ifndef APT_PKGMODULE_H +static struct _PyAptPkgAPIStruct *_PyAptPkg_API; + +static int import_apt_pkg(void) { +# if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 1 + _PyAptPkg_API = (_PyAptPkgAPIStruct *)PyCapsule_Import("apt_pkg._C_API", 0); +# else + _PyAptPkg_API = (_PyAptPkgAPIStruct *)PyCObject_Import("apt_pkg", "_C_API"); +# endif // PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 1 + return (_PyAptPkg_API != NULL) ? 0 : -1; +} + +# define PyAcquire_Type *(_PyAptPkg_API->acquire_type) +# define PyAcquireFile_Type *(_PyAptPkg_API->acquirefile_type) +# define PyAcquireItem_Type *(_PyAptPkg_API->acquireitem_type) +# define PyAcquireItemDesc_Type *(_PyAptPkg_API->acquireitemdesc_type) +# define PyAcquireWorker_Type *(_PyAptPkg_API->acquireworker_type) +# define PyActionGroup_Type *(_PyAptPkg_API->actiongroup_type) +# define PyCache_Type *(_PyAptPkg_API->cache_type) +# define PyCacheFile_Type *(_PyAptPkg_API->cachefile_type) +# define PyCdrom_Type *(_PyAptPkg_API->cdrom_type) +# define PyConfiguration_Type *(_PyAptPkg_API->configuration_type) +# define PyDepCache_Type *(_PyAptPkg_API->depcache_type) +# define PyDependency_Type *(_PyAptPkg_API->dependency_type) +# define PyDependencyList_Type *(_PyAptPkg_API->dependencylist_type) +# define PyDescription_Type *(_PyAptPkg_API->description_type) +# define PyHashes_Type *(_PyAptPkg_API->hashes_type) +# define PyHashString_Type *(_PyAptPkg_API->hashstring_type) +# define PyIndexRecords_Type *(_PyAptPkg_API->indexrecords_type) +# define PyMetaIndex_Type *(_PyAptPkg_API->metaindex_type) +# define PyPackage_Type *(_PyAptPkg_API->package_type) +# define PyPackageFile_Type *(_PyAptPkg_API->packagefile_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) +# define PyPolicy_Type *(_PyAptPkg_API->policy_type) +# define PyProblemResolver_Type *(_PyAptPkg_API->problemresolver_type) +# define PySourceList_Type *(_PyAptPkg_API->sourcelist_type) +# define PySourceRecords_Type *(_PyAptPkg_API->sourcerecords_type) +# define PyTagFile_Type *(_PyAptPkg_API->tagfile_type) +# define PyTagSection_Type *(_PyAptPkg_API->tagsection_type) +# define PyVersion_Type *(_PyAptPkg_API->version_type) +// Code +# define PyAcquire_ToCpp _PyAptPkg_API->acquire_tocpp +# define PyAcquireFile_ToCpp _PyAptPkg_API->acquirefile_tocpp +# define PyAcquireItem_ToCpp _PyAptPkg_API->acquireitem_tocpp +# define PyAcquireItemDesc_ToCpp _PyAptPkg_API->acquireitemdesc_tocpp +# define PyAcquireWorker_ToCpp _PyAptPkg_API->acquireworker_tocpp +# define PyActionGroup_ToCpp _PyAptPkg_API->actiongroup_tocpp +# define PyCache_ToCpp _PyAptPkg_API->cache_tocpp +# define PyCacheFile_ToCpp _PyAptPkg_API->cachefile_tocpp +# define PyCdrom_ToCpp _PyAptPkg_API->cdrom_tocpp +# define PyConfiguration_ToCpp _PyAptPkg_API->configuration_tocpp +# define PyDepCache_ToCpp _PyAptPkg_API->depcache_tocpp +# define PyDependency_ToCpp _PyAptPkg_API->dependency_tocpp +# define PyDependencyList_ToCpp _PyAptPkg_API->dependencylist_tocpp // NULL +# define PyDescription_ToCpp _PyAptPkg_API->description_tocpp +# define PyHashes_ToCpp _PyAptPkg_API->hashes_tocpp +# define PyHashString_ToCpp _PyAptPkg_API->hashstring_tocpp +# define PyIndexRecords_ToCpp _PyAptPkg_API->indexrecords_tocpp +# define PyMetaIndex_ToCpp _PyAptPkg_API->metaindex_tocpp +# define PyPackage_ToCpp _PyAptPkg_API->package_tocpp +# define PyPackageFile_ToCpp _PyAptPkg_API->packagefile_tocpp +# define PyIndexFile_ToCpp _PyAptPkg_API->packageindexfile_tocpp +# define PyPackageList_ToCpp _PyAptPkg_API->packagelist_tocpp // NULL +# define PyPackageManager_ToCpp _PyAptPkg_API->packagemanager_tocpp +# define PyPackageRecords_ToCpp _PyAptPkg_API->packagerecords_tocpp +# define PyPolicy_ToCpp _PyAptPkg_API->policy_tocpp +# define PyProblemResolver_ToCpp _PyAptPkg_API->problemresolver_tocpp +# define PySourceList_ToCpp _PyAptPkg_API->sourcelist_tocpp +# define PySourceRecords_ToCpp _PyAptPkg_API->sourcerecords_tocpp // NULL +# define PyTagFile_ToCpp _PyAptPkg_API->tagfile_tocpp +# define PyTagSection_ToCpp _PyAptPkg_API->tagsection_tocpp +# define PyVersion_ToCpp _PyAptPkg_API->version_tocpp +// Get the C++ object +# define PyAcquire_FromCpp _PyAptPkg_API->acquire_fromcpp +# define PyAcquireFile_FromCpp _PyAptPkg_API->acquirefile_fromcpp +# define PyAcquireItem_FromCpp _PyAptPkg_API->acquireitem_fromcpp +# define PyAcquireItemDesc_FromCpp _PyAptPkg_API->acquireitemdesc_fromcpp +# define PyAcquireWorker_FromCpp _PyAptPkg_API->acquireworker_fromcpp +# define PyActionGroup_FromCpp _PyAptPkg_API->actiongroup_fromcpp +# define PyCache_FromCpp _PyAptPkg_API->cache_fromcpp +# define PyCacheFile_FromCpp _PyAptPkg_API->cachefile_fromcpp +# define PyCdrom_FromCpp _PyAptPkg_API->cdrom_fromcpp +# define PyConfiguration_FromCpp _PyAptPkg_API->configuration_fromcpp +# define PyDepCache_FromCpp _PyAptPkg_API->depcache_fromcpp +# define PyDependency_FromCpp _PyAptPkg_API->dependency_fromcpp +# define PyDependencyList_FromCpp _PyAptPkg_API->dependencylist_fromcpp // NULL +# define PyDescription_FromCpp _PyAptPkg_API->description_fromcpp +# define PyHashes_FromCpp _PyAptPkg_API->hashes_fromcpp +# define PyHashString_FromCpp _PyAptPkg_API->hashstring_fromcpp +# define PyIndexRecords_FromCpp _PyAptPkg_API->indexrecords_fromcpp +# define PyMetaIndex_FromCpp _PyAptPkg_API->metaindex_fromcpp +# define PyPackage_FromCpp _PyAptPkg_API->package_fromcpp +# define PyPackageFile_FromCpp _PyAptPkg_API->packagefile_fromcpp +# define PyIndexFile_FromCpp _PyAptPkg_API->packageindexfile_fromcpp +# define PyPackageList_FromCpp _PyAptPkg_API->packagelist_fromcpp // NULL +# define PyPackageManager_FromCpp _PyAptPkg_API->packagemanager_fromcpp +# define PyPackageRecords_FromCpp _PyAptPkg_API->packagerecords_fromcpp +# define PyPolicy_FromCpp _PyAptPkg_API->policy_fromcpp +# define PyProblemResolver_FromCpp _PyAptPkg_API->problemresolver_fromcpp +# define PySourceList_FromCpp _PyAptPkg_API->sourcelist_fromcpp +# define PySourceRecords_FromCpp _PyAptPkg_API->sourcerecords_fromcpp // NULL +# define PyTagFile_FromCpp _PyAptPkg_API->tagfile_fromcpp +# define PyTagSection_FromCpp _PyAptPkg_API->tagsection_fromcpp +# define PyVersion_FromCpp _PyAptPkg_API->version_fromcpp +# endif // APT_PKGMODULE_H + +#endif + |
