| Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
of Configuration.
This makes isinstance(apt_pkg.config, apt_pkg.Configuration) return True
instead of False.
|
|
Generalized the code a bit, so we can now access the various attributes
of AcquireItem in the AcquireFile (pkgAcqFile is a subclass of
pkgAcquire::Item).
This will allow us to implement a raw object with a single pointer to
an Item later, which we will need for the new progress interface.
|
|
Drop these functions, because they cause segfaults and memory leaks. To
replace this functionality, simply create/delete a Cache object. This
way, reference counting can work.
|
|
mark a package as automatically installed.
|
|
|
|
We can not keep the old apt_pkg.Version constant, because the name Version
is already used by the Version class.
|
|
If you want to subclass apt_pkg.Cache() and create an apt_pkg.DepCache()
object in it (e.g. as self.depcache) this is needed because otherwise,
Python would not know about the cyclic dependency and refuse to free any
of them.
This also changes apt_pkg.Cache to the standard deallocation schema,
because the underlying CacheFile deletes its pointers automatically on
deletion. Thus a second call is not needed.
|
|
objects.
We can not delete the AcquireFile object's pointer on deallocation because
this would cause the item to be removed from the fetcher, which would be
incompatible to the previous behaviour.
We can not delete the IndexFile object's pointer on deallocation because
it is managed by other objects like MetaIndex.
|
|
|
|
|
|
|
|
|
|
|
|
Deleting the pointers caused a crash because those pointers will also be
deleted by closing the cache file.
|
|
We previously called the destructor of the pointer. This resulted in no
object using pointers being deallocated.
This patch introduces CppDeallocPtr() and CppOwnedDeallocPtr() which do
the same as the other CppDealloc() and CppOwnedDealloc(), but use 'delete'
on the pointer instead of the deconstructor.
Furthermore, this patch also changes AcquireFile to be a CppOwnedPyObject,
owned by the Acquire object. Without this change, deleting the Acquire
object would cause a crash when AcquireFile is deallocated.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
when none is found.
|
|
|
|
PyObject_NEW/DEL
This allows us to finally implement subclassing. Previously deletion of an
instance of a subclass caused segmentation faults, this is not the case
anymore.
|
|
|
|
This changes the progress classes to use PEP 8 names. Due to the concept of the
deprecation system, this causes methods of subclasses not to be called at all.
If a class implements a command with underscores, it is called. If the class
also implements the version in mixedCase, this is ignored. This means that
all subclasses will not work correctly, because only the method from the
parent class is called.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
descriptors.
|
|
|
|
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).
|
|
- add update_status_full() that takes file_size/partial_size as
additional callback arguments
- add pulse_items() that takes a addtional "items" tuple that
gives the user full access to the individual items that are
fetched
* python/progress.cc:
- low level code for update_status_full and pulse_items()
|
|
|
|
|
|
Some names may be changed before the release, but this is a good draft.
|
|
Instead of accessing the modules __dict__ directly, we should use the
functions provided by Python to add objects to the module.
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
This time, it is a bit more complicated because we have to raise an
AttributeError when no package has been looked up.
|
|
|