Minor packaging cleanup.

- Use shortcut dist.version instead of going through metadata;
- Use %r throughout to display project names and paths.
This commit is contained in:
Éric Araujo 2011-07-29 02:37:21 +02:00
parent 7b0908a8e4
commit bab50cb124
5 changed files with 21 additions and 21 deletions

View file

@ -72,7 +72,7 @@ class DependencyGraph:
self.missing[distribution].append(requirement)
def _repr_dist(self, dist):
return '%r %s' % (dist.name, dist.metadata['Version'])
return '%r %s' % (dist.name, dist.version)
def repr_node(self, dist, level=1):
"""Prints only a subgraph"""
@ -145,7 +145,7 @@ def generate_graph(dists):
graph.add_distribution(dist)
provides = (dist.metadata['Provides-Dist'] +
dist.metadata['Provides'] +
['%s (%s)' % (dist.name, dist.metadata['Version'])])
['%s (%s)' % (dist.name, dist.version)])
for p in provides:
comps = p.strip().rsplit(" ", 1)