Hi Julian, On Wed, Mar 03, 2010 at 08:07:51PM +0100, Julian Andres Klode wrote: > 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)
I tried this, and ran into corruption if tagfile had more than 30 or 40 paragraphs... See #572596 [1]. For what it's worth, I like the interface a lot better, so I'll be glad to use it once it all works right. :) [1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572596 -- John Wright <j...@debian.org> -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org