Use defaultdict for toolchains information
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 13 Jan 2009 11:52:22 +0000 (11:52 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 13 Jan 2009 11:52:22 +0000 (11:52 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2172 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BToolchainPage.py
wizard/bertos_utils.py

index a7438e6fde71ce92a77609c3185422d2b4956b90..8d4101bac8ae2f80f1f0610de9a004d4ef61fd4e 100644 (file)
@@ -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()"))
index 646be2eeb36763c1f72728a841a73e0fc346d8cb..8f91878d151a71fceea48b00f71494eeb9141741 100644 (file)
@@ -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: