Commits

Kelsey Hightower committed aa918ce

pep8/pyflakes fixes for distutils2.depgraph

  • Participants
  • Parent commits 9958a8d

Comments (0)

Files changed (1)

File distutils2/depgraph.py

             if label is not None:
                 dist = '%s [%s]' % (dist, label)
             output.append('    ' * level + '%s' % dist)
-            suboutput = self.repr_node(other, level+1)
+            suboutput = self.repr_node(other, level + 1)
             subs = suboutput.split('\n')
             output.extend(subs[1:])
         return '\n'.join(output)
     :rtype: an :class:`DependencyGraph` instance
     """
     graph = DependencyGraph()
-    provided = {} # maps names to lists of (version, dist) tuples
-    dists = list(dists) # maybe use generator_tools in future
+    provided = {}  # maps names to lists of (version, dist) tuples
+    dists = list(dists)  # maybe use generator_tools in future
 
     # first, build the graph and find out the provides
     for dist in dists:
         graph.add_distribution(dist)
-        provides = (dist.metadata['Provides-Dist'] + dist.metadata['Provides'] +
+        provides = (dist.metadata['Provides-Dist'] +
+                    dist.metadata['Provides'] +
                     ['%s (%s)' % (dist.name, dist.metadata['Version'])])
 
-
         for p in provides:
             comps = p.strip().rsplit(" ", 1)
             name = comps[0]
                 if len(version) < 3 or version[0] != '(' or version[-1] != ')':
                     raise DistutilsError('Distribution %s has ill formed' \
                                          'provides field: %s' % (dist.name, p))
-                version = version[1:-1] # trim off parenthesis
+                version = version[1:-1]  # trim off parenthesis
             if not name in provided:
                 provided[name] = []
             provided[name].append((version, dist))
                         match = predicate.match(version)
                     except IrrationalVersionError:
                         # XXX small compat-mode
-                        if version.split(' ' ) == 1:
+                        if version.split(' ') == 1:
                             match = True
                         else:
                             match = False
         raise ValueError('The given distribution is not a member of the list')
     graph = generate_graph(dists)
 
-    dep = [dist] # dependent distributions
-    fringe = graph.reverse_list[dist] # list of nodes we should inspect
+    dep = [dist]  # dependent distributions
+    fringe = graph.reverse_list[dist]  # list of nodes we should inspect
 
     while not len(fringe) == 0:
         node = fringe.pop()
             if not prev in dep:
                 fringe.append(prev)
 
-    dep.pop(0) # remove dist from dep, was there to prevent infinite loops
+    dep.pop(0)  # remove dist from dep, was there to prevent infinite loops
     return dep
 
+
 def main():
     from distutils2._backport.pkgutil import get_distributions
     tempout = StringIO()