On Thu, Sep 11, 2014 at 02:21:34PM +0200, Stefano Zacchiroli wrote: > + return itertools.chain([self.header], (p for p in self.__paragraphs))
As additional rationale for this change: there seems to be no way, with the current copyright API, to iterate over the various paragraphs in the debian/copyright file, that preserves the parsing order. That is IMHO desirable, e.g. for rendering purposes more complex than what currently dump() offers. As an alternative to this implementation, one might want to expose __paragraphs as a read-only property, but that would have the inconvenient of excluding the header paragraph. All in all I prefer the approach implemented by this patch (surprise surprise :-)). In addition to this change, we might also consider making Copyright objects themselves iterable, by simply calling all_paragraphs() behind the scenes. (FWIW even in that case I would still keep all_paragraphs() around, for uniformity with the other all_* methods.) [ And, of course, Murphy law: I've though about this only immediately after the upload. Oh well... ] > -License: ABC > - [ABC TEXT] > - > Files: debian/* > Copyright: Copyright 2003 Debian Developer <[email protected]> > License: 123 > @@ -111,6 +108,9 @@ Copyright: Copyright 2003 Debian Developer > <[email protected]> > Copyright 2004 Someone Else <[email protected]> > License: 123 > > +License: ABC > + [ABC TEXT] > + > License: 123 > [123 TEXT] I've changed the paragraph order in one of the copyright test cases to have a simple way to test all_paragraphs(), which was ruled out by the interleaving of Files and License paragraphs. AFAICT this has no adverse effect on other tests. Cheers. -- Stefano Zacchiroli . . . . . . . [email protected] . . . . o . . . o . o Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o Former Debian Project Leader . . @zack on identi.ca . . o o o . . . o . « the first rule of tautology club is the first rule of tautology club »
signature.asc
Description: Digital signature
-- http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-python-debian-maint
