summaryrefslogtreecommitdiff
path: root/python/tag.cc
AgeCommit message (Collapse)AuthorFilesLines
2015-07-05Merge git://anonscm.debian.org/apt/python-aptIgor Pashev1-26/+69
Conflicts: debian/changelog python/apt_pkgmodule.cc
2015-06-10TagFile: Provide close() and context managerJulian Andres Klode1-0/+58
This is mostly meant to be used with tag files that are opened with a path, rather than a file object. Closes: #748922
2014-09-03fix testsMichael Vogt1-1/+1
2014-09-02python/tag.cc: ensure that the final \n is there when duplicating section dataMichael Vogt1-4/+7
2014-06-10Revert "Merge remote-tracking branch 'mvo/feature/srcrec-enum' into debian/sid"Michael Vogt1-2/+1
This reverts commit 1b6b123a052ca2d53e90b62da09ce300d701265a, reversing changes made to 9de6a183f09f0d0adbcc5817872c5a0024f5ef47.
2014-06-10Merge remote-tracking branch 'mvo/feature/srcrec-enum' into debian/sidMichael Vogt1-1/+2
Conflicts: debian/control
2014-03-22python/tag.cc: Ignore missing 'encoding' attribute in file objectsJulian Andres Klode1-0/+2
In case the encoding attribute does not exist, Python sets an exception. We must thus clear the exception, otherwise it might be raised at some later point in the code.
2013-10-08apt_pkg: Support paths supplied as bytes objects (See: #680971)Julian Andres Klode1-3/+2
We should be done now. DO NOT MERGE
2013-09-11Remove old API compatibility C++ support codeJulian Andres Klode1-19/+0
2013-08-31Use HAVE_OPEN_MEMSTREAMIgor Pashev1-0/+2
2012-10-15* python/tag.cc:Michael Vogt1-2/+2
- make TagSecString_FromStringAndSize, TagSecString_FromString static, thanks to jcristau
2012-06-17* python/tag.cc:Julian Andres Klode1-2/+2
- Correctly handle file descriptor 0 aka stdin (Closes: #669458)
2012-06-15Merge patch from Colin Watson to handle non-UTF8 tag files inJulian Andres Klode1-29/+99
Python 3, by using bytes instead of str when requested; and document this in the RST documentation (Closes: #656288)
2012-02-06python/tag.cc: make it build with older apt versions tooMichael Vogt1-0/+5
2012-02-06python/tag.cc: cleanupMichael Vogt1-8/+4
2012-02-03* python/tag.cc, tests/test_tagfile.py:Michael Vogt1-9/+35
- add support a filename argument in apt_pkg.TagFile() (in addition to the file object currently supported)
2011-11-10fix build against apt in experimentalMichael Vogt1-0/+1
2011-04-12apt_pkg: Fix unsigned/long-vs-int issues (LP: #610820)Julian Andres Klode1-2/+3
This fix is large, but simple in concept. Instead of relying on Py_BuildValue and type signatures, or type-specific conversion functions, create a new set of overloaded MkPyNumber() functions that automatically do the right thing for each numerical type.
2010-09-08* apt/debfile.py:Michael Vogt1-1/+5
- remove bogus comment * python/tag.cc: - allow "bytes" type in TagSecNew (for python3)
2010-07-23* python/tag.cc:Julian Andres Klode1-0/+5
- Support gzip compression for control files (Closes: #383617), requires APT (>> 0.7.26~exp10) to work.
2010-04-21python: Commit documentation changes suggested by debian-l10n-english.Julian Andres Klode1-11/+12
2010-04-01python: Document every class, function, property.Julian Andres Klode1-29/+53
Finally, a complete reference to apt_pkg available via pydoc and __doc__ attributes.
2010-04-01python: Return bool instead of int to Python where possible, looks better.Julian Andres Klode1-8/+6
2010-03-05* python/tag.cc:Julian Andres Klode1-0/+16
- Hack the TagFile iterator to not use shared storage (Closes: #572596): Scan once, duplicate the section data, and scan again.
2010-02-27* python:Julian Andres Klode1-16/+3
- Handle deprecated attributes and methods in the tp_gettattro slot, this allows us to easily warn if a deprecated function is used.
2010-02-13python/tagfile.cc: Implement the iterator protocol in TagFile.Julian Andres Klode1-5/+31
2010-01-27Merge the CppOwnedPyObject C++ class into CppPyObject.Julian Andres Klode1-5/+5
2009-07-30Merge 0.7.11.1-0.7.12.0 from unstable.Julian Andres Klode1-0/+25
2009-07-27* python/tag.cc:Michael Vogt1-0/+24
- merge patch from John Wright that adds FindRaw method (closes: #538723)
2009-07-14python/tag.cc: TagFileData is now subclassed from CppOwnedPyObject<pkgTagFile>.Julian Andres Klode1-7/+8
2009-07-13python: No zero-size arrays for char *kwlist[].Julian Andres Klode1-2/+2
2009-07-13python: Rename all PyTypeObject's to conform to PEP 7.Julian Andres Klode1-6/+6
This is the first step towards implementing coding guidelines for the C++ code and providing an usable C++ API.
2009-06-25python: Use PyVarObject_HEAD_INIT() instead of PyObject_HEAD_INIT().Julian Andres Klode1-8/+4
This is related to PEP 3123 and fixes some compiler warnings.
2009-06-25python/tag.cc: Return False for non-strings in 'TagSection.__contains__()'.Julian Andres Klode1-0/+2
2009-06-25python/tag.cc: Store the return value of PyString_AsString as const char*.Julian Andres Klode1-1/+1
2009-06-21python: Make all CppOwnedPyObjects and similar support garbage collection.Julian Andres Klode1-9/+28
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.
2009-06-21python: Add DeprecationWarning to functions which were replaced by classes.Julian Andres Klode1-0/+6
2009-06-09Allow types providing __new__() to be subclassed.Julian Andres Klode1-2/+4
2009-06-08python/generic.h,tag.cc,configuration.cc: Use tp_alloc/tp_free instead of ↵Julian Andres Klode1-4/+4
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.
2009-06-05python/: Put all deprecated Get*() functions into #ifdef COMPAT_0_7.Julian Andres Klode1-0/+4
2009-06-04python/: Unify naming conventions for all new names.Julian Andres Klode1-1/+1
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/: Convert most names to PEP8 naming conventions (except ↵Julian Andres Klode1-0/+15
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-15/+60
Some names may be changed before the release, but this is a good draft.
2009-04-15* Introduce support for Python 3 (Closes: #523645)Julian Andres Klode1-0/+4
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-14* Remove any trailing whitespaceJulian Andres Klode1-6/+6
2009-04-13* python/*.cc: Use PyObject_AsFileDescriptor instead of fileno(PyFile_AsFile)Julian Andres Klode1-2/+5
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-17/+30
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-16/+31
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.
2008-05-16Remove trailing whitespace.Ben Finney1-42/+42