deb822: support for "parsed" dependencies

Stefano Zacchiroli zack at debian.org
Thu Jun 19 20:14:05 UTC 2008


On Thu, Jun 19, 2008 at 04:08:37PM +0200, Stefano Zacchiroli wrote:
> A doubt I have is if it is a good idea to have top-level methods (as in
> pkg.depends(), pkg.recommends(), ...) or if it would be better to have a
> wrapper for that (as in pkg.rels['depends'] , pkg.rels['recommends'],
> ...). Suggestions?

After a second thought I didn't like to pollute the Deb822 methodspace
with methods whose names depend on class attributes in the inheriting
class. Hence I went for a single top-level (read-only) property
".relations" which returns a dictionary with keys following 822 stanza
field names.  The usage is hence now something like

  pkg.relations['depends']

For convenience all possible inter-package relationships (for the given
class) are always part of the dictionary. At worst they are empty if
they were not in the 822 stanza in the first place.

There is now an example (called "depgraph", which was actually my motif
to develop this) and a test (which fails, bug yet to be fixed).

Cheers.

-- 
Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
I'm still an SGML person,this newfangled /\ All one has to do is hit the
XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-python-debian-discuss/attachments/20080619/cf1a58d2/attachment.pgp 


More information about the pkg-python-debian-discuss mailing list