summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Pratte <guillaume@guillaumepratte.net>2012-04-21 18:25:22 -0400
committerGuillaume Pratte <guillaume@guillaumepratte.net>2012-04-21 18:25:22 -0400
commit6076dd84aaa4d4313be65a171331c91bd9412019 (patch)
treed5504c5a71548d1613f9f7b76ed209ef75ea6b0e
parent20e1ef7ac5e1c470f2327a5aaa38e75a219ad491 (diff)
downloaddisutils2-6076dd84aaa4d4313be65a171331c91bd9412019.tar.gz
remove changes that modified output of pysetup graph: tests are needed first
-rw-r--r--distutils2/depgraph.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/distutils2/depgraph.py b/distutils2/depgraph.py
index abaefc2..30a2528 100644
--- a/distutils2/depgraph.py
+++ b/distutils2/depgraph.py
@@ -71,16 +71,18 @@ class DependencyGraph:
"""
self.missing[distribution].append(requirement)
+ def _repr_dist(self, dist):
+ return '%r %s' % (dist.name, dist.version)
+
def repr_node(self, dist, level=1):
"""Prints only a subgraph"""
output = []
- output.append(str(dist))
- # XXX: this code needs cleanup
+ output.append(self._repr_dist(dist))
for other, label in self.adjacency_list[dist]:
- dist = str(other)
+ dist = self._repr_dist(other)
if label is not None:
dist = '%s [%s]' % (dist, label)
- output.append(' ' * level + dist)
+ output.append(' ' * level + str(dist))
suboutput = self.repr_node(other, level + 1)
subs = suboutput.split('\n')
output.extend(subs[1:])