From: duplo Date: Fri, 23 Jan 2009 18:36:02 +0000 (+0000) Subject: Permit cyclic graphs in module dependencies X-Git-Tag: 2.1.0~461 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=de4e90c7ff6428672deb13cc9a2533f10d997067;p=bertos.git Permit cyclic graphs in module dependencies git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2221 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index f2ecdeba..39cf91d9 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -169,19 +169,21 @@ class BModulePage(BWizardPage): QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) def selectDependencyCheck(self, module): - unsatisfied = [] + unsatisfied = set() modules = self._projectInfoRetrieve("MODULES") for dependency in modules[module]["depends"]: if not modules[dependency]["enabled"]: - unsatisfied.append(dependency) - unsatisfied += self.selectDependencyCheck(dependency) + unsatisfied |= set([dependency]) + if dependency not in unsatisfied: + unsatisfied |= self.selectDependencyCheck(dependency) return unsatisfied def unselectDependencyCheck(self, dependency): - unsatisfied = [] + unsatisfied = set() modules = self._projectInfoRetrieve("MODULES") for module, informations in modules.items(): if dependency in informations["depends"] and informations["enabled"]: - unsatisfied.append(module) - unsatisfied += self.unselectDependencyCheck(module) + unsatisfied |= set([module]) + if dependency not in unsatisfied: + unsatisfied |= self.unselectDependencyCheck(module) return unsatisfied \ No newline at end of file