X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=wizard%2FBToolchainPage.py;h=100abb5666488b290da0f2e3c8d3085f21e0ace5;hb=28200763bd0b90237ce7bc2133857f5e3148c044;hp=a2929b5dc135b293c0f0e1b4adefd53b5529fdfe;hpb=80a0b725c40c4b7f6981009aa6b3d1824acd19b1;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index a2929b5d..100abb56 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -79,7 +79,7 @@ class BToolchainPage(BWizardPage): newData.update(infos) item.setData(Qt.UserRole, qvariant_converter.convertStringDict(newData)) needed = self._projectInfoRetrieve("CPU_INFOS") - if infos["target"].find(needed["TOOLCHAIN"]) != -1: + if "target" in infos.keys() and infos["target"].find(needed["TOOLCHAIN"]) != -1: item.setIcon(QIcon(":/images/ok.png")) else: item.setIcon(QIcon(":/images/warning.png")) @@ -118,18 +118,31 @@ class BToolchainPage(BWizardPage): def validateToolchain(self, i): filename = qvariant_converter.getStringDict(self.pageContent.toolchainList.item(i).data(Qt.UserRole))["path"] - self._validationProcess = QProcess() - self._validationProcess.start(filename, ["-v"]) - self._validationProcess.waitForStarted(1000) - if self._validationProcess.waitForFinished(200): - description = str(self._validationProcess.readAllStandardError()) - infos = bertos_utils.getToolchainInfo(description) - if len(infos.keys()) >= 4: - self._validItem(i, infos) + valid = False + info = {} + ## Check for the other tools of the toolchain + for tool in TOOLCHAIN_ITEMS: + if os.path.exists(filename.replace("gcc", tool)): + valid = True else: - self._invalidItem(i) + valid = False + break + ## Try to retrieve the informations about the toolchain only for the valid toolchains + if valid: + self._validationProcess = QProcess() + self._validationProcess.start(filename, ["-v"]) + self._validationProcess.waitForStarted(1000) + if self._validationProcess.waitForFinished(200): + description = str(self._validationProcess.readAllStandardError()) + info = bertos_utils.getToolchainInfo(description) + if len(info.keys()) >= 4: + valid = True + else: + self._validationProcess.kill() + ## Add the item in the list with the appropriate associate data. + if valid: + self._validItem(i, info) else: - self._validationProcess.kill() self._invalidItem(i) toolchains = self.toolchains() toolchains[filename] = True