mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Remove tasks not in tasklist from dependency graph
Use filter() for filtering instead of list comprehensions
This commit is contained in:
parent
237dde9285
commit
29394270c6
1 changed files with 5 additions and 4 deletions
|
@ -38,11 +38,12 @@ class TaskList(object):
|
|||
from common.phases import order
|
||||
graph = {}
|
||||
for task in tasks:
|
||||
graph[task] = []
|
||||
graph[task].extend([self.get(succ) for succ in task.before])
|
||||
graph[task].extend([succ for succ in tasks if type(task) in succ.after])
|
||||
successors = []
|
||||
successors.extend([self.get(succ) for succ in task.before])
|
||||
successors.extend(filter(lambda succ: type(task) in succ.after, tasks))
|
||||
succeeding_phases = order[order.index(task.phase)+1:]
|
||||
graph[task].extend([succ for succ in tasks if succ.phase in succeeding_phases])
|
||||
successors.extend(filter(lambda succ: succ.phase in succeeding_phases, tasks))
|
||||
graph[task] = filter(lambda succ: succ in self.tasks, successors)
|
||||
|
||||
components = self.strongly_connected_components(graph)
|
||||
cycles_found = 0
|
||||
|
|
Loading…
Add table
Reference in a new issue