From b5eaec9ae59579faf3d2facea7ede3fb8ef64032 Mon Sep 17 00:00:00 2001 From: duplo Date: Tue, 13 Jan 2009 11:52:22 +0000 Subject: [PATCH] Use defaultdict for toolchains information git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2172 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BToolchainPage.py | 4 +++- wizard/bertos_utils.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index a7438e6f..8d4101ba 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -10,6 +10,7 @@ # import os +import collections from BWizardPage import * import BToolchainSearch @@ -42,7 +43,8 @@ class BToolchainPage(BWizardPage): self.pageContent.toolchainList.clear() def _selectionChanged(self): - infos = qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole)) + infos = collections.defaultdict(lambda: unicode("not defined")) + infos.update(qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole))) self.pageContent.infoLabel.setText("GCC " + infos["version"] + " (" + infos["build"] + ")\nTarget: " + infos["target"] + "\nThread model: " + infos["thread"]) self.pageContent.infoLabel.setVisible(True) self.emit(SIGNAL("completeChanged()")) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 646be2ee..8f91878d 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -13,7 +13,6 @@ import os import fnmatch import glob import re -import collections import const @@ -45,7 +44,7 @@ def findToolchains(pathList): return list(set(toolchains)) def getToolchainInfo(output): - info = collections.defaultdict(unicode) + info = {} expr = re.compile("Target: .*") target = expr.findall(output) if len(target) == 1: -- 2.25.1