Bug#552190: python-debian: python DeprecationWarning
Julian Andres Klode
jak at debian.org
Wed Mar 3 19:07:51 UTC 2010
Am Mittwoch, den 17.02.2010, 16:34 -0700 schrieb John Wright:
> On Wed, Feb 17, 2010 at 11:54:22AM +0100, Julian Andres Klode wrote:
> > On Thu, Jan 28, 2010 at 03:24:37PM -0700, John Wright wrote:
> > > I have a branch that uses the new TagFile interface. I'll try to merge
> > > that in and upload this week or weekend. I also had a "fix" to ignore
> > > the DeprecationWarning in my local git tree, but I never got around to
> > > pushing or uploading. Sorry about that.
> > >
> > > Thanks for the reminder!
> >
> > You might want to wait for 0.7.93.2 and use the iterator API therein,
> > which does not even use shared storage and should thus be more useful
> > for python-debian.
>
> Ok. Right now we're avoiding shared storage by using a TagFile instance
> for each Deb822 instance returned by its iter_paragraphs class method.
> But it would be nice not to have to do that. :)
>
> I'm not sure if we'll wait, but I'll definitely be converting deb822 to
> the new interface when it's available.
The new interface is available since 0.7.93.2, and provides a one-time
iterable tagfile (TagFile is an iterator itself; just like file is).
for section in tagfile:
print section[key]
Each 'section' refers to a single objects with its own data. Thus you
can also do things like::
sections = list(tagfile)
Have fun!
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
More information about the pkg-python-debian-maint
mailing list