From a1e26d32d35b6cf246eec4a0cf72adf4d895cac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=BCllhorst?= Date: Sun, 29 May 2016 20:33:40 +0200 Subject: [PATCH] Updated dependency detection. --- cloud/LocalGraph.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cloud/LocalGraph.py b/cloud/LocalGraph.py index eb3ac93..e81eaf8 100644 --- a/cloud/LocalGraph.py +++ b/cloud/LocalGraph.py @@ -58,8 +58,20 @@ class LocalGraph(Graph): return nodes def getNodesWithNoDependencies(self): - #TODO: Implement smarter selection - return self.getAllNodesWithDepthEquals(self.getMaxDepth()) + nodesWithNoDependencies = [] + for k,v in self.__nodes__.items(): + depth = self.getDeptOfNode(v) + hasDependencies = False + for link in self.getLinksByNodeID(k): + for node in link.getEndpointNodes(): + if depth < self.getDeptOfNode(node): + hasDependencies = True + break + if hasDependencies == True: + break + else: + nodesWithNoDependencies.append(v) + return nodesWithNoDependencies def isAutoupdaterEnabledOnAllNodes(self): for k, v in self.__nodes__.items():