[Python-checkins] distutils2: remove changes that modified output of pysetup graph: tests are needed first

eric.araujo python-checkins at python.org
Wed May 16 07:07:26 CEST 2012


http://hg.python.org/distutils2/rev/64b0bf5e0596
changeset:   1318:64b0bf5e0596
user:        Guillaume Pratte <guillaume at guillaumepratte.net>
date:        Sat Apr 21 18:25:22 2012 -0400
summary:
  remove changes that modified output of pysetup graph: tests are needed first

files:
  distutils2/depgraph.py |  10 ++++++----
  1 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/distutils2/depgraph.py b/distutils2/depgraph.py
--- a/distutils2/depgraph.py
+++ b/distutils2/depgraph.py
@@ -71,16 +71,18 @@
         """
         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:])

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list