summaryrefslogtreecommitdiff
path: root/python/apt_pkgmodule.cc
AgeCommit message (Collapse)AuthorFilesLines
2009-07-16python/acquire.cc: Introduce PyAcquireWorker_Type, make ↵Julian Andres Klode1-6/+7
PyAcquireItemDesc_Type contain a pointer.
2009-07-15python/acquire.cc: Add AcquireItemDesc.Julian Andres Klode1-0/+2
2009-07-15Introduce new progress (base) classes in apt_pkg:Julian Andres Klode1-0/+2
- apt_pkg.AcquireProgress - apt_pkg.OpProgress
2009-07-15python/python-apt.h: Introduce the C++ APIJulian Andres Klode1-0/+38
The C++ API provides support for creating Python objects from C++ objects given by pointer or reference (depending on the implementation of the Python object) and for retrieving the underlying C++ object from the Python object and for checking the type of the Python object.
2009-07-14python/configuration.cc: Unify all ↵Julian Andres Klode1-5/+4
Configuration,ConfigurationPtr,ConfigurationSub into one type. This makes the whole API easier. The disadvantage is that we require 8 bytes (??) more per object for the owner object pointer, which is NULL for most cases (the only exception being objects created by Configuration.sub_tree).
2009-07-13python/apt_pkgmodule.cc: Remove all dependendy type constants, and cleanup.Julian Andres Klode1-87/+41
The dependency type constants have no use, because we do not export values anywhere. The cleanup moves all #ifdef COMPAT_0_7 together into one section.
2009-07-13python/apt_pkgmodule.cc: Fix build on Python 2.4Julian Andres Klode1-1/+1
2009-07-13python/apt_pkgmodule.cc: Add function name to ParseDepends and friends.Julian Andres Klode1-6/+7
2009-07-13python/apt_pkgmodule.cc, python/apt_instmodule.cc: Remove useless state.Julian Andres Klode1-22/+7
This was copied over from "Porting Extension Modules to 3.0", and is not really needed.
2009-07-13python/apt_pkgmodule.cc: ParseDepends_old only needed in COMPAT_0_7.Julian Andres Klode1-0/+2
2009-07-13python: Rename all PyTypeObject's to conform to PEP 7.Julian Andres Klode1-31/+31
This is the first step towards implementing coding guidelines for the C++ code and providing an usable C++ API.
2009-07-12python/hashes.cc: Introduce the Hashes class.Julian Andres Klode1-0/+1
The Hashes class is a function which calculates all supported hashes for one input. DebImg will use this for calculating the hashes of files.
2009-07-08python/apt_pkgmodule.cc: Unify dep handling -- part 1: parse_depends()Julian Andres Klode1-5/+14
apt_pkg.parse_[src_]depends() now use CompType instead of CompTypeDeb (i.e. < instead of <<) to match the interface of Version.depends_list_str.
2009-06-21python/apt_pkgmodule.cc: Delete apt_pkg.Version constant [API break]Julian Andres Klode1-1/+1
We can not keep the old apt_pkg.Version constant, because the name Version is already used by the Version class.
2009-06-21python: Add DeprecationWarning to functions which were replaced by classes.Julian Andres Klode1-0/+2
2009-06-09python/apt_pkgmodule.cc: Fix the modulename.Julian Andres Klode1-1/+1
2009-06-09Add apt_pkg.Policy class (Closes: #382725)Julian Andres Klode1-0/+1
2009-06-09python/cache.cc: Fix segfaults using the new allocation methods.Julian Andres Klode1-2/+3
We switched to using tp_alloc() to create new objects. Some types had no tp_flags set and were not initialized using PyType_Ready, causing tp_alloc (PyType_GenericAlloc) to crash.
2009-06-08Add apt_pkg.HashString and apt_pkg.IndexRecords (Closes: #456141)Julian Andres Klode1-0/+2
2009-06-05python/: Put all deprecated Get*() functions into #ifdef COMPAT_0_7.Julian Andres Klode1-0/+2
2009-06-05python/apt_pkgmodule.cc: Fix refcount problem.Julian Andres Klode1-1/+3
2009-06-05Introduce the rename rules formally, and add some exceptions.Julian Andres Klode1-8/+8
2009-06-04python/apt_pkgmodule.cc: Make sure all types are ready.Julian Andres Klode1-18/+1
2009-06-04python/: Unify naming conventions for all new names.Julian Andres Klode1-18/+18
Unify all names to follow these rules: 1. Replace the first [A-Z] with the lowercase version [a-z] 2. Replace multiple [A-Z] with [A-Z][a-z] (one upper, remaining ones lowercase) 3. Replace all remaining [A-Z] with _[a-z] This brings us from 'FileName' to 'file_name' and from 'DescURI' to 'desc_uri'. We will at a later stage add some exceptions to this rule, like 'filename' instead of 'file_name', to improve readability.
2009-06-03python/apt_pkgmodule.cc: Rename STATE_* constants.Julian Andres Klode1-15/+15
2009-06-03python/: Convert most names to PEP8 naming conventions (except ↵Julian Andres Klode1-3/+91
Version,PackageFile,MetaIndex). On our way to close Bug#481061, this converts almost all names to PEP 8 naming conventions. Missing are now apt_pkg.Version, apt_pkg.PackageFile, apt_pkg.MetaIndex and apt.progress.*. In case of the missing apt_pkg classes, they are not converted yet because they do not use getset descriptors yet. apt.progress.* has not been converted yet because the extension interacts with it, and we first need to modify the extension to recognize the new names, as well as the old names (old applications shouldn't break).
2009-04-24* python/*.cc: Fix build failures with python2.4-dbg.Julian Andres Klode1-2/+2
2009-04-19* python/*.cc: Export all types and add a __new__() method to them.Julian Andres Klode1-0/+49
Some names may be changed before the release, but this is a good draft.
2009-04-17* python/apt_pkgmodule.cc: Do not access the modules __dict__.Julian Andres Klode1-60/+44
Instead of accessing the modules __dict__ directly, we should use the functions provided by Python to add objects to the module.
2009-04-16* apt/*.py: Initial rename work for Bug#481061Julian Andres Klode1-0/+6
A new module, apt.deprecation, is introduced containing functions and classes which assist in the deprecation. The apt_pkg extension gets a new attribute, _COMPAT_0_7 which can be set by defining COMPAT_0_7 at compile time (-DCOMPAT_0_7). The names are changed, and compatibility functions are enabled if bool(apt_pkg._COMPAT_0_7) == True, i.e. if the package has been built with backward compatibility fixes. This commit changes the apt and aptsources packages, the apt_pkg and apt_inst extensions will be the next renames.
2009-04-15* python: Port AcquireItem,Package,Description to GetSetJulian Andres Klode1-1/+3
2009-04-15* Introduce support for Python 3 (Closes: #523645)Julian Andres Klode1-23/+64
This is the first initial port to Python 3. The API is almost completely identical to the one found in Python 2, except that functions working with binary data require bytes (md5sum,sha1sum,sha256sum,Base64Encode). Using setup3.py to install the modules will not work, because the apt package still has to be converted to Python 3. For the package, we call 2to3-3.1 in debian/rules to do this automatically.
2009-04-15* python/pkgrecords.cc: Use GetSet for PkgRecordsTypeJulian Andres Klode1-0/+1
2009-04-14* python/pkgsrcrecords.cc: Use GetSet properties for PkgSrcRecordsTypeJulian Andres Klode1-0/+1
This time, it is a bit more complicated because we have to raise an AttributeError when no package has been looked up.
2009-04-14* python/pkgmanager.cc: Use tp_methods and tp_getset for PkgManagerTypeJulian Andres Klode1-0/+1
2009-04-14* python/indexfile.cc: Use tp_methods and tp_getset for PackageIndexFileTypeJulian Andres Klode1-0/+1
2009-04-14* python/acquire.cc: Use tp_methods and tp_getset for PkgAcquireTypeJulian Andres Klode1-0/+1
2009-04-14* python/depcache.cc: Use tp_methods and tp_getset for PkgDepCacheTypeJulian Andres Klode1-0/+1
2009-04-14* python/cache.cc: Add tp_getset and tp_methods to DependencyType.Julian Andres Klode1-0/+1
2009-04-14* python/cache.cc: Use tp_methods and tp_getset for PkgCacheTypeJulian Andres Klode1-0/+1
2009-04-14* python/acquire.cc, python/sourcelist.cc: Type cleanupJulian Andres Klode1-0/+1
Use GetSet for PkgSourceListType and remove tp_getattr from PkgAcquireFileType.
2009-04-14* Remove any trailing whitespaceJulian Andres Klode1-1/+1
2009-04-13* python/cdrom.cc, python/depcache.cc: Use tp_methods for Cdrom, ↵Julian Andres Klode1-0/+4
ProblemResolver, ActionGroup
2009-04-13* python/configuration.cc: Support the 'in' operator for ConfigurationJulian Andres Klode1-0/+3
Support the replacement of mapping.has_key() for Configuration,ConfigurationPtr and ConfigurationSub objects. This is implemented by extending the various types with the tp_as_sequence slot, which refers to a PySequenceMethods containing only this method. The CnfGetAttr() function has been removed and replaced by the use of the tp_method slot. This helps the py3k port because the previously used Py_FindMethod() is not avilable anymore. This completes the support of the 'in' operator in all python-apt objects, which makes it even easier to convert python-apt-using applications to py3k once python-apt supports it, as 2to3 converts 'm.has_key(k)' to 'k in m'. Also finalize the types in apt_pkgmodule.cc and add the new 'key in conf' description to the documentation.
2009-04-13* python/*.cc: Use PyObject_AsFileDescriptor instead of fileno(PyFile_AsFile)Julian Andres Klode1-6/+6
Replace support for file objects with a more generic support for any object providing a fileno() method and for file descriptors (integers). This also helps us to port to Python 3, where the previously used PyFile_ functions are not available anymore.
2009-04-13* apt/tag.cc: Rework TagFile using tp_methods and tp_getsetJulian Andres Klode1-0/+1
By using tp_methods and tp_getset instead of a function for tp_getattr, the resulting object is easier to understand and access to attributes and methods is faster. It also helps the port to Python 3, where Py_FindMethod does not exist anymore.
2009-04-13* python/tag.cc: Support 'key in mapping' for TagSectionsJulian Andres Klode1-0/+4
Support the replacement of mapping.has_key() for sections, and update the usage in apt/package.py and apt/debfile accordingly. This is implemented by extending the TagSecType with sequence methods, but only settings the contains method there. The TagSecGetAttr() function has been removed and replaced by the use of the tp_methods slot.
2009-01-29* apt/cache.py:Michael Vogt1-0/+1
- when setting a alternative rootdir, read the config from it as well * python/configuration.cc, python/apt_pkgmodule.cc: - add apt_pkg.ReadConfigDir()
2009-01-11Merge Ben Finney's whitespace changes (Closes: #481563)Julian Andres Klode1-53/+53
2008-11-07python/acquire.cc (GetPkgAcqFile): Support DestDir and DestFilename.Michael Vogt1-1/+1