X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=a12a82a124fae23236b132aae6d9a65fe6e3519a;hb=861b72bbf12340a6d838923e09db145d28538697;hp=a2ecfeb550a13f563f0f3cddac45dd8ae713c175;hpb=98c9cd8fdcf45680606672eb88317d76a509c9fa;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index a2ecfeb5..a12a82a1 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -54,7 +54,7 @@ class BToolchainPage(BWizardPage): def _search(self): dirList = self.searchDirList() - if(self.pathSearch()): + if self.pathSearch(): dirList += [element for element in bertos_utils.getSystemPath()] toolchainList = bertos_utils.findToolchains(dirList) storedToolchains = self.toolchains() @@ -79,11 +79,12 @@ 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")) - item.setText("GCC " + infos["version"] + " - " + infos["target"]) + if "version" in infos.keys() and "target" in infos.keys(): + item.setText("GCC " + infos["version"] + " - " + infos["target"]) def _invalidItem(self, index): item = self.pageContent.toolchainList.item(index) @@ -113,23 +114,38 @@ class BToolchainPage(BWizardPage): search.exec_() def validateAllToolchains(self): + QApplication.instance().setOverrideCursor(Qt.WaitCursor) for i in range(self.pageContent.toolchainList.count()): self.validateToolchain(i) + QApplication.instance().restoreOverrideCursor() 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