diff options
author | Guillaume Pratte <guillaume@guillaumepratte.net> | 2012-04-21 18:25:22 -0400 |
---|---|---|
committer | Guillaume Pratte <guillaume@guillaumepratte.net> | 2012-04-21 18:25:22 -0400 |
commit | 6076dd84aaa4d4313be65a171331c91bd9412019 (patch) | |
tree | d5504c5a71548d1613f9f7b76ed209ef75ea6b0e | |
parent | 20e1ef7ac5e1c470f2327a5aaa38e75a219ad491 (diff) | |
download | disutils2-6076dd84aaa4d4313be65a171331c91bd9412019.tar.gz |
remove changes that modified output of pysetup graph: tests are needed first
-rw-r--r-- | distutils2/depgraph.py | 10 |
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:]) |