#431087: Packages iteration return dictionaries
John Wright
john at movingsucks.org
Sat Jun 30 15:35:16 UTC 2007
On Sat, Jun 30, 2007 at 03:02:39PM +0200, Stefano Zacchiroli wrote:
> Hi ... from a new project member fwiw :)
>
> I'm going to commit the patch I proposed in the bugreport. IMO it
> implements what I think is the right way to iterate over packages,
> namely having dictionary objects. Still it breaks a bit backward
> compatibility, but I hope in this early stages of the project we are not
> too concerned about that ...
>
> Just let me know if this is not the case.
>
> Cheers.
Stefano,
This is implemented in the deb822 module, which is currently in unstable
as python-deb822, but will be integrated in with python-debian at some
point. (A slightly outdated version of the source is in python-debian
already; I need to figure out the best way to either transition from it
being a "top-level" package to one under the "debian" package, or else
make the python-debian source build the python-deb822 binary...)
In particular, see the deb822.Packages.iter_paragraphs method. deb822
preserves case and order when "dumping" back out to RFC822 format and
also provides case-insensitive dictionary-like access.
Thanks,
John
More information about the pkg-python-debian-discuss
mailing list