From: batt Date: Thu, 29 Apr 2010 12:37:58 +0000 (+0000) Subject: Fix suitable toolchain finding process. X-Git-Tag: 2.5.0~337 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=210d3a59a53817287e38abc6c82c739d107687a9;p=bertos.git Fix suitable toolchain finding process. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3571 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BRoutePage.py b/wizard/BRoutePage.py index b34f7900..d8e6d370 100644 --- a/wizard/BRoutePage.py +++ b/wizard/BRoutePage.py @@ -78,18 +78,19 @@ class BRoutePage(BWizardPage): cpu_info = self.projectInfo("CPU_INFOS") if cpu_info: target = cpu_info["TOOLCHAIN"] + # Try to find a suitable toolchain automatically + tm = ToolchainManager() + suitable_toolchains = tm.suitableToolchains(target) + if len(suitable_toolchains) == 1: + return self.wizard().pageIndex(BOutputPage) + else: + return self.wizard().pageIndex(BToolchainPage) else: # It seems that the nextId method is called before the # reloadData one (that is called after the page changing. # # TODO: fix this awful code lines target = None - # Try to find a suitable toolchain automatically - tm = ToolchainManager() - suitable_toolchains = tm.suitableToolchains(target) - if len(suitable_toolchains) == 1: - return self.wizard().pageIndex(BOutputPage) - else: return self.wizard().pageIndex(BToolchainPage) #### diff --git a/wizard/toolchain_manager.py b/wizard/toolchain_manager.py index 8f18d9a9..6b6f359e 100755 --- a/wizard/toolchain_manager.py +++ b/wizard/toolchain_manager.py @@ -127,7 +127,8 @@ class ToolchainManager(object): toolchains = self.toolchains suitable_toolchains = [] for name, info in toolchains: - if info and info.get('target', None) == target: + t = info.get("target", None) + if t and t.find(target) != -1: suitable_toolchains.append(name) return suitable_toolchains